当前位置: 首页>>代码示例>>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;未经允许,请勿转载。