本文整理汇总了TypeScript中ui-router-ng2.Transition.to方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Transition.to方法的具体用法?TypeScript Transition.to怎么用?TypeScript Transition.to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui-router-ng2.Transition
的用法示例。
在下文中一共展示了Transition.to方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
deregistrationFns.push($transitions.onSuccess({}, (transition: Transition) => {
let toState = transition.to();
var titleKey = 'global.title' ;
// Set the page title key to the one configured in state or use default one
if (toState.data.pageTitle) {
titleKey = toState.data.pageTitle;
}
//JhiLanguageService.updateTitle(titleKey); //TODO needs to fixed after migration
}));
示例2:
$transitions.onStart({}, (transition: Transition) => {
let $storageService = transition.injector().get(StateStorageService);
$storageService.storeDestinationState(transition.to(), transition.params(), transition.from());
let principal = transition.injector().get(Principal);
let auth = transition.injector().get(AuthService);
if (principal.isIdentityResolved()) {
auth.authorize();
}
});