本文整理汇总了TypeScript中@uirouter/core.UIRouter类的典型用法代码示例。如果您正苦于以下问题:TypeScript UIRouter类的具体用法?TypeScript UIRouter怎么用?TypeScript UIRouter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UIRouter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
($uiRouter: UIRouter, $log: ILogService) => {
const subscription = $uiRouter.globals.start$.subscribe((transition: Transition) => {
const details = {
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', { ...details, error });
transition.promise.then(success, failure);
});
$uiRouter.disposable({ dispose: () => subscription.unsubscribe() });
},
示例2:
bootstrapModule.config(($uiRouterProvider: UIRouter) => {
'ngInject';
$uiRouterProvider.plugin(UIRouterRxPlugin);
});
示例3:
($uiRouterProvider: UIRouter) => {
$uiRouterProvider.plugin(UIRouterRxPlugin);
},
示例4: createVisualizer
function createVisualizer() {
if (visualizerEnabled !== 'true') {
return;
}
// Cleanup any current visualizer first
destroyVisualizer();
if (VisualizerPlugin) {
$uiRouter.plugin(VisualizerPlugin);
} else {
loadVisualizer();
}
}
示例5: destroyVisualizer
const createVisualizer = () => {
if (!visualizerEnabled) {
return;
}
// Cleanup any current visualizer first
destroyVisualizer();
if (VisualizerPlugin) {
$uiRouter.plugin(VisualizerPlugin);
} else {
loadVisualizer();
}
};
示例6: destroyVisualizer
function destroyVisualizer() {
const plugin = $uiRouter.getPlugin('visualizer');
plugin && $uiRouter.dispose(plugin);
}
示例7:
const destroyVisualizer = () => {
const plugin = $uiRouter.getPlugin('visualizer');
plugin && $uiRouter.dispose(plugin);
};