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