当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ember-metal.get函数代码示例

本文整理汇总了TypeScript中ember-metal.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: computed

 transitioningIn: computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn(this: any) {
   if (get(this, 'willBeActive') === true && !get(this, '_active')) {
     return 'ember-transitioning-in';
   } else {
     return false;
   }
 }),
开发者ID:GowthamMK,项目名称:ember.js,代码行数:7,代码来源:link-to.ts

示例2: 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:GowthamMK,项目名称:ember.js,代码行数:13,代码来源:link-to.ts

示例3: templateFor

 templateFor(component: Component, env: Environment): OwnedTemplate {
   let Template = get(component, 'layout');
   let owner = component[OWNER];
   if (Template) {
     return env.getTemplate(Template, owner);
   }
   let layoutName = get(component, 'layoutName');
   if (layoutName) {
     let template = owner.lookup('template:' + layoutName);
     if (template) {
       return template;
     }
   }
   return owner.lookup(DEFAULT_LAYOUT);
 }
开发者ID:fpauser,项目名称:ember.js,代码行数:15,代码来源:curly.ts

示例4: 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:Artmann,项目名称:ember.js,代码行数:27,代码来源:references.ts

示例5: 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 (MANDATORY_SETTER) {
        watchKey(parentValue, _propertyKey);
      }

      if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) {
        this.tag.didCompute(parentValue);
      }

      return get(parentValue, _propertyKey);
    } else {
      return undefined;
    }
  }
开发者ID:jasonmit,项目名称:ember.js,代码行数:27,代码来源:references.ts

示例6: iterate

  iterate() {
    let { ref, keyFor, valueTag } = this;

    let iterable = ref.value();

    valueTag.inner.update(tagForProperty(iterable, '[]'));

    if (iterable === null || typeof iterable !== 'object') {
      return EMPTY_ITERATOR;
    }

    if (Array.isArray(iterable)) {
      return iterable.length > 0 ? new ArrayIterator(iterable, keyFor) : EMPTY_ITERATOR;
    } else if (isEmberArray(iterable)) {
      return get(iterable, 'length') > 0 ? new EmberArrayIterator(iterable, keyFor) : EMPTY_ITERATOR;
    } else if (typeof iterable.forEach === 'function') {
      let array: any[] = [];
      iterable.forEach((item: any) => {
        array.push(item);
      });
      return array.length > 0 ? new ArrayIterator(array, keyFor) : EMPTY_ITERATOR;
    } else {
      return EMPTY_ITERATOR;
    }
  }
开发者ID:fpauser,项目名称:ember.js,代码行数:25,代码来源:iterable.ts


注:本文中的ember-metal.get函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。