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


TypeScript ListWrapper.map方法代码示例

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


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

示例1: constructResolvingPath

function constructResolvingPath(keys) {
  if (keys.length > 1) {
    var reversed = findFirstClosedCycle(ListWrapper.reversed(keys));
    var tokenStrs = ListWrapper.map(reversed, (k) => stringify(k.token));
    return " (" + tokenStrs.join(' -> ') + ")";
  } else {
    return "";
  }
}
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:9,代码来源:exceptions.ts

示例2: genPipeOnDestroy

 /**
  * Generates statements destroying all pipe variables.
  */
 genPipeOnDestroy(): string {
   return ListWrapper.join(
       ListWrapper.map(
           ListWrapper.filter(this.records, (r) => { return r.isPipeRecord(); }),
           (r) => {
             return `${this.utilName}.callPipeOnDestroy(${this.getPipeName(r.selfIndex)});`;
           }),
       '\n');
 }
开发者ID:lavinjj,项目名称:angular,代码行数:12,代码来源:codegen_name_util.ts

示例3: _getElementId

function _getElementId(element): List<number> {
  var elId = DOM.getData(element, NG_ID_PROPERTY);
  if (isPresent(elId)) {
    return ListWrapper.map(StringWrapper.split(elId, NG_ID_SEPARATOR_RE),
                           (partStr) => NumberWrapper.parseInt(partStr, 10));
  } else {
    return null;
  }
}
开发者ID:AsherBarak,项目名称:angular,代码行数:9,代码来源:debug_element_view_listener.ts

示例4: keyValues

 function keyValues(templateBindings) {
   return ListWrapper.map(templateBindings, (binding) => {
     if (binding.keyIsVar) {
       return '#' + binding.key + (isBlank(binding.name) ? '' : '=' + binding.name);
     } else {
       return binding.key + (isBlank(binding.expression) ? '' : `=${binding.expression}`);
     }
   });
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:9,代码来源:parser_spec.ts

示例5: _resolveDependencies

 _resolveDependencies(key: Key, binding: ResolvedBinding, forceAsync: boolean): List<any> {
   try {
     var getDependency = d => this._getByKey(d.key, forceAsync || d.asPromise, d.lazy, d.optional);
     return ListWrapper.map(binding.dependencies, getDependency);
   } catch (e) {
     this._clear(key);
     if (e instanceof AbstractBindingError) e.addKey(key);
     throw e;
   }
 }
开发者ID:Muthamizhan,项目名称:angular,代码行数:10,代码来源:injector.ts

示例6: _resolveDependencies

 _resolveDependencies(key, binding, forceAsync) {
   try {
     var getDependency = (d) => this._getByKey(d.key, forceAsync || d.asPromise, d.lazy, d.optional);
     return ListWrapper.map(binding.dependencies, getDependency);
   } catch (e) {
     this._clear(key);
     if (e instanceof ProviderError)
       e.addKey(key);
     throw e;
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:11,代码来源:injector.ts

示例7:

 this._printStringRow(ListWrapper.map(this._metricNames, (metricName) => {
   var sample =
       ListWrapper.map(validSample, (measureValues) => measureValues.values[metricName]);
   var mean = Statistic.calculateMean(sample);
   var cv = Statistic.calculateCoefficientOfVariation(sample, mean);
   var formattedMean = ConsoleReporter._formatNum(mean)
                           // Note: Don't use the unicode character for +- as it might cause
                           // hickups for consoles...
                           return NumberWrapper.isNaN(cv) ?
                           formattedMean :
                           `${formattedMean}+-${Math.floor(cv)}%`;
 }));
开发者ID:CADBOT,项目名称:angular,代码行数:12,代码来源:console_reporter.ts

示例8: BaseException

 result = this.renderer.compile(template).then((pv) => {
   var childComponentPromises = ListWrapper.map(this._findNestedComponentIds(template, pv), (componentId) => {
     var childTemplate = MapWrapper.get(this._templates, componentId);
     if (isBlank(childTemplate)) {
       throw new BaseException(`Could not find template for ${componentId}!`);
     }
     return this._compileRecurse(childTemplate);
   });
   return PromiseWrapper.all(childComponentPromises).then((protoViewRefsWithChildren) => {
     var protoViewRefs = ListWrapper.map(protoViewRefsWithChildren, (arr) => arr[0]);
     return this._flattenList([this.renderer.mergeChildComponentProtoViews(pv.render, protoViewRefs), protoViewRefsWithChildren]);
   });
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:13,代码来源:integration_testbed.ts

示例9: constructor

 constructor(typeOrFunc, params: List<List<any>>) {
   super();
   var signature = [];
   for (var i = 0, ii = params.length; i < ii; i++) {
     var parameter = params[i];
     if (isBlank(parameter) || parameter.length == 0) {
       signature.push('?');
     } else {
       signature.push(ListWrapper.map(parameter, stringify).join(' '));
     }
   }
   this.message = "Cannot resolve all parameters for " + stringify(typeOrFunc) + "(" +
                  signature.join(', ') + "). " +
                  'Make sure they all have valid type or annotations.';
 }
开发者ID:KenWilliamson,项目名称:Angular2HostedMobileApp,代码行数:15,代码来源:exceptions.ts

示例10: commit

  /**
   *
   */
  commit(instruction: Instruction): Promise<List<any>> {
    this._currentInstruction = instruction;

    // collect all outlets that do not have a corresponding child instruction
    // and remove them from the internal map of child outlets
    var toDeactivate = ListWrapper.create();
    MapWrapper.forEach(this._outlets, (outlet, outletName) => {
      if (!instruction.hasChild(outletName)) {
        MapWrapper.delete(this._outlets, outletName);
        ListWrapper.push(toDeactivate, outlet);
      }
    });

    return PromiseWrapper.all(ListWrapper.map(toDeactivate, (outlet) => outlet.deactivate()))
        .then((_) => this.activate(instruction));
  }
开发者ID:Mariem-07,项目名称:angular,代码行数:19,代码来源:router.ts


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