本文整理匯總了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);
};