本文整理汇总了TypeScript中aurelia-router.Router.navigateToRoute方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Router.navigateToRoute方法的具体用法?TypeScript Router.navigateToRoute怎么用?TypeScript Router.navigateToRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-router.Router
的用法示例。
在下文中一共展示了Router.navigateToRoute方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: save
public save() {
if (!this.canSave) {
return;
}
this.storage.saveTodo(this.todo);
this.router.navigateToRoute('list');
}
示例2: alert
this.ds.login(name, pwd).then(user => {
if (user) {
this.session.setUser(user);
this.router.navigateToRoute("dispatch");
} else {
alert("Interner Fehler: Login misslungen");
}
});
示例3:
return this.ds.login().then(user => {
if (user) {
this.session.setUser(user);
return this.router.navigateToRoute("dispatch");
} else {
return true;
}
});
示例4: scroll
// TODO: Use custom attribute and/or Aurelia DOM Element injection
scroll(row) {
let name = row.config.name;
this.router.navigateToRoute(name);
let element = document.querySelectorAll(name)[0];
if (!!element) {
element.scrollIntoView();
// {
// behavior: "smooth"
// });
}
}
示例5: activate
public async activate() {
try {
log.info("Got response from OAuth")
const result = await this.fhir.getSmartclient();
log.info("Loaded Smart client")
sessionStorage.setItem("ch.webelexis.logintoken", result);
// alert("we are logged in!");
// TODO: Set correct user
this.session.setUser({
id: "admin@webelexis.ch",
roles: ["admin", "guest", "user", "mpa"]
});
this.router.navigateToRoute("dispatch");
} catch (err) {
log.error("Smartclient failed: %s", err)
alert("SmartClient failed " + err);
}
}
示例6: viewTodo
public viewTodo(todo: Todo) {
this.router.navigateToRoute('edit', {id: todo.id});
}
示例7: addJob
addJob() {
this.router.navigateToRoute("addJob");
}
示例8: searchForSummoners
searchForSummoners() {
this._router.navigateToRoute('summoner-champions', { summonerName: this.searchText }, { trigger: true });
}
示例9: cancel
public cancel() {
this.router.navigateToRoute('list');
}