本文整理匯總了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');
}