本文整理汇总了TypeScript中angular2/router.Router.navigateByInstruction方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Router.navigateByInstruction方法的具体用法?TypeScript Router.navigateByInstruction怎么用?TypeScript Router.navigateByInstruction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/router.Router
的用法示例。
在下文中一共展示了Router.navigateByInstruction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: goToCustomer
public goToCustomer(partnerId: number) {
var instructions = this._router.root.generate(['/Customer', {
id: partnerId
}]);
this._dossierService.createDossier(instructions, 'Kunde');
this._router.navigateByInstruction(instructions);
}
示例2: onTap
/**
* onTap function will check _preFunction first
* then do the navigation.
*/
onTap(): void {
if(this._preFunction) {
Promise.resolve(this._preFunction()).then((res) => {
this._router.navigateByInstruction(this._navigationInstruction);
});
} else {
this._router.navigateByInstruction(this._navigationInstruction);
}
}
示例3: goToContract
public goToContract(partnerId: number, contractId: number) {
var instructions = this._router.root.generate(['/Customer', {
id: partnerId
}, 'Contract', {
category: 'vertrag',
categoryId: contractId
}]);
this._dossierService.createDossier(instructions, 'Kunde');
this._router.navigateByInstruction(instructions);
}
示例4:
.then((result) => {
if (result) {
if (!auth.isAdmin) {
router.navigateByInstruction(router.generate(['/Restricted']), true);
return false;
}
return true;
} else {
router.navigate(['/Login', {target}]);
return false;
}
});
示例5: routerOnActivate
routerOnActivate(next: ComponentInstruction, prev: ComponentInstruction) {
if (window.confirm('Are you sure you want to logout?')) {
this.auth.logout();
}
if (prev) {
let previous = new ResolvedInstruction(prev, null, {});
this.router.navigateByInstruction(previous);
} else {
this.router.navigate(['/Home']);
}
return false;
}
示例6: navigateToMailbox
public navigateToMailbox() {
this._interactionService.requestSave();
let caption = 'Briefkasten',
instructions = this._router.generate(['/Mailbox']);
const dossiers = this._dossierService.getAll();
const dossier = dossiers.find(d => d.caption === caption);
if (!dossier) {
this._dossierService.createDossier(instructions, caption);
}
this._router.navigateByInstruction(instructions);
}
示例7:
Promise.resolve(this._preFunction()).then((res) => {
this._router.navigateByInstruction(this._navigationInstruction);
});
示例8:
.then((carrier: RouteInstruction)=> {
this._outstandingChildRoutingUrl = carrier.outstandingPath;
return this._router.navigateByInstruction(carrier.instruction);
})
示例9: onTap
onTap(): void {
log("NSRouterLink onTap() instruction: " + JSON.stringify(this._navigationInstruction))
this._router.navigateByInstruction(this._navigationInstruction);
}
示例10: navigatePage
navigatePage(id) {
let instruction = this.router.generate(['../PostsPage', { id: id }]);
this.router.navigateByInstruction(instruction);
}