當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript core.Transition類代碼示例

本文整理匯總了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;未經允許,請勿轉載。