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


TypeScript metal.get函數代碼示例

本文整理匯總了TypeScript中@ember/-internals/metal.get函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript get函數的具體用法?TypeScript get怎麽用?TypeScript get使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了get函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: computeLinkToComponentTransitioningIn

 function computeLinkToComponentTransitioningIn(this: any) {
   if (get(this, 'willBeActive') === true && !get(this, '_active')) {
     return 'ember-transitioning-in';
   } else {
     return false;
   }
 }
開發者ID:rlivsey,項目名稱:ember.js,代碼行數:7,代碼來源:link-to.ts

示例2: computeLinkToComponentTransitioningOut

 function computeLinkToComponentTransitioningOut(this: any) {
   if (get(this, 'willBeActive') === false && get(this, '_active')) {
     return 'ember-transitioning-out';
   } else {
     return false;
   }
 }
開發者ID:cibernox,項目名稱:ember.js,代碼行數:7,代碼來源:link-to.ts

示例3: computeLinkToComponentLoading

    function computeLinkToComponentLoading(this: any) {
      let qualifiedRouteName = get(this, 'qualifiedRouteName');
      let modelsAreLoaded = get(this, '_modelsAreLoaded');

      if (!modelsAreLoaded || qualifiedRouteName === null || qualifiedRouteName === undefined) {
        return get(this, 'loadingClass');
      }
    }
開發者ID:habdelra,項目名稱:ember.js,代碼行數:8,代碼來源:link-to.ts

示例4: computed

  willBeActive: computed('_routing.targetState', function computeLinkToComponentWillBeActive(
    this: any
  ) {
    let routing = this._routing;
    let targetState = get(routing, 'targetState');
    if (get(routing, 'currentState') === targetState) {
      return;
    }

    return this._isActive(targetState);
  }),
開發者ID:habdelra,項目名稱:ember.js,代碼行數:11,代碼來源:link-to.ts

示例5: computeLinkToComponentQualifiedRouteName

 function computeLinkToComponentQualifiedRouteName(this: any) {
   let params = get(this, 'params');
   let paramsLength = params.length;
   let lastParam = params[paramsLength - 1];
   if (lastParam && lastParam.isQueryParams) {
     paramsLength--;
   }
   let onlyQueryParamsSupplied = this[HAS_BLOCK] ? paramsLength === 0 : paramsLength === 1;
   if (onlyQueryParamsSupplied) {
     return get(this, '_routing.currentRouteName');
   }
   return get(this, 'targetRouteName');
 }
開發者ID:habdelra,項目名稱:ember.js,代碼行數:13,代碼來源:link-to.ts

示例6: compute

  compute() {
    let { _parentReference, _parentObjectTag, _propertyKey } = this;

    let parentValue = _parentReference.value();

    _parentObjectTag.inner.update(tagForProperty(parentValue, _propertyKey));

    let parentValueType = typeof parentValue;

    if (parentValueType === 'string' && _propertyKey === 'length') {
      return parentValue.length;
    }

    if ((parentValueType === 'object' && parentValue !== null) || parentValueType === 'function') {
      if (DEBUG) {
        watchKey(parentValue, _propertyKey);
      }

      if (DEBUG) {
        (this.tag.inner as TwoWayFlushDetectionTag).didCompute(parentValue);
      }

      return get(parentValue, _propertyKey);
    } else {
      return undefined;
    }
  }
開發者ID:Turbo87,項目名稱:ember.js,代碼行數:27,代碼來源:references.ts

示例7: computeLinkToComponentActive

 function computeLinkToComponentActive(this: any) {
   let currentState = get(this, '_routing.currentState');
   if (!currentState) {
     return false;
   }
   return this._isActive(currentState);
 }
開發者ID:cibernox,項目名稱:ember.js,代碼行數:7,代碼來源:link-to.ts

示例8: compute

  compute() {
    let { _parentValue, _propertyKey } = this;

    if (DEBUG) {
      (this.tag.inner as TwoWayFlushDetectionTag).didCompute(_parentValue);
    }

    let parent: any;
    let tracker: any;

    if (EMBER_METAL_TRACKED_PROPERTIES) {
      parent = getCurrentTracker();
      tracker = setCurrentTracker();
    }

    let ret = get(_parentValue, _propertyKey);

    if (EMBER_METAL_TRACKED_PROPERTIES) {
      setCurrentTracker(parent!);
      let tag = tracker!.combine();
      if (parent) parent.add(tag);

      this._propertyTag.inner.update(tag);
    }

    return ret;
  }
開發者ID:cibernox,項目名稱:ember.js,代碼行數:27,代碼來源:references.ts

示例9: isActiveForRoute

  isActiveForRoute(
    contexts: {}[],
    queryParams: {},
    routeName: string,
    routerState: any,
    isCurrentWhenSpecified: any
  ) {
    let router = get(this, 'router');

    let handlers = router._routerMicrolib.recognizer.handlersFor(routeName);
    let leafName = handlers[handlers.length - 1].handler;
    let maximumContexts = numberOfContextsAcceptedByHandler(routeName, handlers);

    // NOTE: any ugliness in the calculation of activeness is largely
    // due to the fact that we support automatic normalizing of
    // `resource` -> `resource.index`, even though there might be
    // dynamic segments / query params defined on `resource.index`
    // which complicates (and makes somewhat ambiguous) the calculation
    // of activeness for links that link to `resource` instead of
    // directly to `resource.index`.

    // if we don't have enough contexts revert back to full route name
    // this is because the leaf route will use one of the contexts
    if (contexts.length > maximumContexts) {
      routeName = leafName;
    }

    return routerState.isActiveIntent(routeName, contexts, queryParams, !isCurrentWhenSpecified);
  }
開發者ID:GreatWizard,項目名稱:ember.js,代碼行數:29,代碼來源:routing.ts

示例10: get

    readValue = (args: any) => {
      let valuePath = valuePathRef.value();

      if (valuePath && args.length > 0) {
        args[0] = get(args[0], valuePath as string);
      }

      return args;
    };
開發者ID:habdelra,項目名稱:ember.js,代碼行數:9,代碼來源:action.ts


注:本文中的@ember/-internals/metal.get函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。