本文整理汇总了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
}