本文整理匯總了TypeScript中@uirouter/core.Transition.params方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Transition.params方法的具體用法?TypeScript Transition.params怎麽用?TypeScript Transition.params使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@uirouter/core.Transition
的用法示例。
在下文中一共展示了Transition.params方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: return
return (transition: Transition): HookResult => {
const previousValue = transition.params('from')[paramName];
const newValue = transition.params('to')[paramName];
if (previousValue === newValue) {
return null;
}
return changedHandler(newValue, previousValue);
};
示例2:
const subscription = $uiRouter.globals.start$.subscribe((transition: Transition) => {
const details = {
transition: transition,
toState: transition.to(),
toParams: transition.params('to'),
fromState: transition.from(),
fromParams: transition.params('from'),
};
$log.debug('$stateChangeStart', details);
const success = () => $log.debug('$stateChangeSuccess', details);
const failure = (error: any) => $log.debug('$stateChangeError', Object.assign(details, { error }));
transition.promise.then(success, failure);
});
示例3: ngOnInit
ngOnInit(){
this.slaId = this.$transition$.params().slaId
}