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


TypeScript StringMapWrapper.forEach方法代码示例

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


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

示例1: _reduceControls

 /** @internal */
 _reduceControls(controlsConfig: any): {[key: string]: modelModule.AbstractControl} {
   var controls: {[key: string]: modelModule.AbstractControl} = {};
   StringMapWrapper.forEach(controlsConfig, (controlConfig, controlName) => {
     controls[controlName] = this._createControl(controlConfig);
   });
   return controls;
 }
开发者ID:hankduan,项目名称:angular,代码行数:8,代码来源:form_builder.ts

示例2: _mergeErrors

 static _mergeErrors(control: modelModule.AbstractControl, res: StringMap<string, any[]>): void {
   StringMapWrapper.forEach(control.errors, (value, error) => {
     if (!StringMapWrapper.contains(res, error)) {
       res[error] = [];
     }
     var current: any[] = res[error];
     current.push(control);
   });
 }
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:9,代码来源:validators.ts

示例3: group

 static group(group: modelModule.ControlGroup): StringMap<string, boolean> {
   var res = {};
   StringMapWrapper.forEach(group.controls, (control, name) => {
     if (group.contains(name) && isPresent(control.errors)) {
       Validators._mergeErrors(control, res);
     }
   });
   return StringMapWrapper.isEmpty(res) ? null : res;
 }
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:9,代码来源:validators.ts

示例4:

 events.forEach(event => {
   if (StringWrapper.equals(event['ph'], 'X')) {
     needSort = true;
     var startEvent = {};
     var endEvent = {};
     StringMapWrapper.forEach(event, (value, prop) => {
       startEvent[prop] = value;
       endEvent[prop] = value;
     });
     startEvent['ph'] = 'B';
     endEvent['ph'] = 'E';
     endEvent['ts'] = startEvent['ts'] + startEvent['dur'];
     this._remainingEvents.push(startEvent);
     this._remainingEvents.push(endEvent);
   } else {
     this._remainingEvents.push(event);
   }
 });
开发者ID:hankduan,项目名称:angular,代码行数:18,代码来源:perflog_metric.ts

示例5: normalizeEvent

function normalizeEvent(chromeEvent: {[key: string]: any},
                        data: {[key: string]: any}): {[key: string]: any} {
  var ph = chromeEvent['ph'];
  if (StringWrapper.equals(ph, 'S')) {
    ph = 'b';
  } else if (StringWrapper.equals(ph, 'F')) {
    ph = 'e';
  }
  var result =
      {'pid': chromeEvent['pid'], 'ph': ph, 'cat': 'timeline', 'ts': chromeEvent['ts'] / 1000};
  if (chromeEvent['ph'] === 'X') {
    var dur = chromeEvent['dur'];
    if (isBlank(dur)) {
      dur = chromeEvent['tdur'];
    }
    result['dur'] = isBlank(dur) ? 0.0 : dur / 1000;
  }
  StringMapWrapper.forEach(data, (value, prop) => { result[prop] = value; });
  return result;
}
开发者ID:hankduan,项目名称:angular,代码行数:20,代码来源:chrome_driver_extension.ts

示例6: describe

 describe(): {[key: string]: any} {
   var res = {
     'scriptTime': 'script execution time in ms, including gc and render',
     'pureScriptTime': 'script execution time in ms, without gc nor render'
   };
   if (this._perfLogFeatures.render) {
     res['renderTime'] = 'render time in ms';
   }
   if (this._perfLogFeatures.gc) {
     res['gcTime'] = 'gc time in ms';
     res['gcAmount'] = 'gc amount in kbytes';
     res['majorGcTime'] = 'time of major gcs in ms';
     if (this._forceGc) {
       res['forcedGcTime'] = 'forced gc time in ms';
       res['forcedGcAmount'] = 'forced gc amount in kbytes';
     }
   }
   if (this._captureFrames) {
     if (!this._perfLogFeatures.frameCapture) {
       var warningMsg = 'WARNING: Metric requested, but not supported by driver';
       // using dot syntax for metric name to keep them grouped together in console reporter
       res['frameTime.mean'] = warningMsg;
       res['frameTime.worst'] = warningMsg;
       res['frameTime.best'] = warningMsg;
       res['frameTime.smooth'] = warningMsg;
     } else {
       res['frameTime.mean'] = 'mean frame time in ms (target: 16.6ms for 60fps)';
       res['frameTime.worst'] = 'worst frame time in ms';
       res['frameTime.best'] = 'best frame time in ms';
       res['frameTime.smooth'] = 'percentage of frames that hit 60fps';
     }
   }
   StringMapWrapper.forEach(this._microMetrics,
                            (desc, name) => { StringMapWrapper.set(res, name, desc); });
   return res;
 }
开发者ID:hankduan,项目名称:angular,代码行数:36,代码来源:perflog_metric.ts

示例7:

 descriptions.forEach(description => {
   StringMapWrapper.forEach(description, (value, prop) => this.description[prop] = value);
 });
开发者ID:hankduan,项目名称:angular,代码行数:3,代码来源:sample_description.ts

示例8: _sortedProps

 static _sortedProps(obj) {
   var props = [];
   StringMapWrapper.forEach(obj, (value, prop) => props.push(prop));
   props.sort();
   return props;
 }
开发者ID:hankduan,项目名称:angular,代码行数:6,代码来源:console_reporter.ts

示例9:

 map => { StringMapWrapper.forEach(map, (value, prop) => { result[prop] = value; }); });
开发者ID:hankduan,项目名称:angular,代码行数:1,代码来源:multi_metric.ts

示例10: sortedKeys

 function sortedKeys(stringMap) {
   var res = [];
   StringMapWrapper.forEach(stringMap, (_, key) => { res.push(key); });
   res.sort();
   return res;
 }
开发者ID:hankduan,项目名称:angular,代码行数:6,代码来源:perflog_metric_spec.ts


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