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


TypeScript ListWrapper.get方法代码示例

本文整理汇总了TypeScript中angular2/src/facade/collection.ListWrapper.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ListWrapper.get方法的具体用法?TypeScript ListWrapper.get怎么用?TypeScript ListWrapper.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular2/src/facade/collection.ListWrapper的用法示例。


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

示例1: setterFactory

export function setterFactory(property: string): Function {
  var setterFn, styleParts, styleSuffix;
  if (StringWrapper.startsWith(property, ATTRIBUTE_PREFIX)) {
    setterFn = attributeSetterFactory(StringWrapper.substring(property, ATTRIBUTE_PREFIX.length));
  } else if (StringWrapper.startsWith(property, CLASS_PREFIX)) {
    setterFn = classSetterFactory(StringWrapper.substring(property, CLASS_PREFIX.length));
  } else if (StringWrapper.startsWith(property, STYLE_PREFIX)) {
    styleParts = property.split(STYLE_SEPARATOR);
    styleSuffix = styleParts.length > 2 ? ListWrapper.get(styleParts, 2) : '';
    setterFn = styleSetterFactory(ListWrapper.get(styleParts, 1), styleSuffix);
  } else if (StringWrapper.equals(property, 'innerHtml')) {
    if (isBlank(innerHTMLSetterCache)) {
      innerHTMLSetterCache = (el, value) => DOM.setInnerHTML(el, value);
    }
    setterFn = innerHTMLSetterCache;
  } else {
    property = resolvePropertyName(property);
    setterFn = StringMapWrapper.get(propertySettersCache, property);
    if (isBlank(setterFn)) {
      var propertySetterFn = reflector.setter(property);
      setterFn = function(receiver, value) {
        if (DOM.hasProperty(receiver, property)) {
          return propertySetterFn(receiver, value);
        }
      };
      StringMapWrapper.set(propertySettersCache, property, setterFn);
    }
  }
  return setterFn;
}
开发者ID:188799958,项目名称:angular,代码行数:30,代码来源:property_setter_factory.ts

示例2:

 ListWrapper.forEach(params, (param: string) => {
   var split: List<string> = StringWrapper.split(param, '=');
   var key = ListWrapper.get(split, 0);
   var val = ListWrapper.get(split, 1);
   var list = map.get(key) || [];
   list.push(val);
   map.set(key, list);
 });
开发者ID:Salim-K,项目名称:angular,代码行数:8,代码来源:url_search_params.ts

示例3:

 ListWrapper.forEach(params, (param: string) => {
   var split: List<string> = StringWrapper.split(param, '=');
   var key = ListWrapper.get(split, 0);
   var val = ListWrapper.get(split, 1);
   var list = MapWrapper.get(map, key) || ListWrapper.create();
   ListWrapper.push(list, val);
   MapWrapper.set(map, key, list);
 });
开发者ID:B-Thapa,项目名称:angular,代码行数:8,代码来源:url_search_params.ts

示例4: RegExp

 ListWrapper.forEach(params, (param: string) => {
   var split: List<string> = StringWrapper.split(param, new RegExp('='));
   var key = ListWrapper.get(split, 0);
   var val = ListWrapper.get(split, 1);
   var list = isPresent(map.get(key)) ? map.get(key) : [];
   list.push(val);
   map.set(key, list);
 });
开发者ID:cedriclam,项目名称:angular,代码行数:8,代码来源:url_search_params.ts

示例5: _getBinding

 _getBinding(key) {
   var binding = this._bindings.length <= key.id ? null : ListWrapper.get(this._bindings, key.id);
   if (isBlank(binding) && this._defaultBindings) {
     return bind(key.token).toClass(key.token);
   } else {
     return binding;
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:8,代码来源:injector.ts

示例6: _addFrameMetrics

 _addFrameMetrics(result: StringMap<string, any>, frameTimes: any[]) {
   result['frameTime.mean'] =
       ListWrapper.reduce(frameTimes, (a, b) => a + b, 0) / frameTimes.length;
   var firstFrame = ListWrapper.get(frameTimes, 0);
   result['frameTime.worst'] = ListWrapper.reduce(frameTimes, (a, b) => a > b ? a : b, firstFrame);
   result['frameTime.best'] = ListWrapper.reduce(frameTimes, (a, b) => a < b ? a : b, firstFrame);
   result['frameTime.smooth'] =
       ListWrapper.filter(frameTimes, (a) => a < _FRAME_TIME_SMOOTH_THRESHOLD).length /
       frameTimes.length;
 }
开发者ID:goderbauer,项目名称:angular,代码行数:10,代码来源:perflog_metric.ts

示例7: _createControl

 _createControl(controlConfig) {
   if (controlConfig instanceof modelModule.Control || controlConfig instanceof modelModule.ControlGroup || controlConfig instanceof modelModule.ControlArray) {
     return controlConfig;
   } else if (ListWrapper.isList(controlConfig)) {
     var value = ListWrapper.get(controlConfig, 0);
     var validator = controlConfig.length > 1 ? controlConfig[1] : null;
     return this.control(value, validator);
   } else {
     return this.control(controlConfig);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:11,代码来源:form_builder.ts

示例8: _getInstance

 _getInstance(key: Key) {
   if (this._instances.length <= key.id) return null;
   return ListWrapper.get(this._instances, key.id);
 }
开发者ID:Muthamizhan,项目名称:angular,代码行数:4,代码来源:injector.ts


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