本文整理汇总了TypeScript中@uirouter/core.Transition类的典型用法代码示例。如果您正苦于以下问题:TypeScript Transition类的具体用法?TypeScript Transition怎么用?TypeScript Transition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Transition类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
};
开发者ID:emjburns,项目名称:deck,代码行数:9,代码来源:paramChangedHelper.ts
示例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);
});
开发者ID:jcwest,项目名称:deck,代码行数:15,代码来源:stateChange.logger.ts
示例3: toggleVisualizer
function toggleVisualizer(trans: Transition) {
const enabled: 'true' | 'false' = trans.paramsChanged().vis;
if (enabled === undefined) {
return null;
}
if (enabled === visualizerEnabled) {
return trans.targetState().withParams({ vis: undefined });
}
visualizerEnabled = enabled;
if (enabled === 'true') {
createVisualizer();
} else if (enabled === 'false') {
destroyVisualizer();
}
return trans.targetState().withParams({ vis: undefined });
}
开发者ID:emjburns,项目名称:deck,代码行数:20,代码来源:uiRouterVisualizer.toggle.ts
示例4: decoratedNg1Hook
function decoratedNg1Hook(trans: Transition, state: Ng1StateDeclaration): HookResult {
let resolveContext = new ResolveContext(trans.treeChanges(pathname));
let locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans });
return services.$injector.invoke(hook, this, locals);
}
开发者ID:apetrosian,项目名称:ui-router,代码行数:5,代码来源:onEnterExitRetain.ts
示例5: path
path(trans: Transition) {
return trans.$to().url.format(trans.params());
}
开发者ID:catrielmuller,项目名称:angulartics2,代码行数:3,代码来源:uirouter.ts
示例6: ngOnInit
ngOnInit(){
this.slaId = this.$transition$.params().slaId
}
开发者ID:prashanthc97,项目名称:kylo,代码行数:3,代码来源:ServiceLevelAgreementInitController.ts
注:本文中的@uirouter/core.Transition类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论