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


TypeScript StringMapWrapper.forEach方法代码示例

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


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

示例1: CompilePipeline

 return new CompilePipeline([new MockStep((parent, current, control) => {
   if (isPresent(propertyBindings)) {
     StringMapWrapper.forEach(propertyBindings, (ast, name) => {
       current.bindElement().bindProperty(name, ast);
     });
   }
 }), new DirectiveParser(parser, annotatedDirectives)]);
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:directive_parser_spec.ts

示例2: MockStep

 new MockStep((parent, current, control) => {
   if (isPresent(propertyBindings)) {
     StringMapWrapper.forEach(propertyBindings, (ast, name) => {
       current.bindElement().bindProperty(name, ast);
     });
   }
 }),
开发者ID:lavinjj,项目名称:angular,代码行数:7,代码来源:directive_parser_spec.ts

示例3: config

  /**
   * Given a component and a configuration object, add the route to this registry
   */
  config(parentComponent, config: StringMap<string, any>): void {
    if (!StringMapWrapper.contains(config, 'path')) {
      throw new BaseException('Route config does not contain "path"');
    }

    if (!StringMapWrapper.contains(config, 'component') &&
        !StringMapWrapper.contains(config, 'components') &&
        !StringMapWrapper.contains(config, 'redirectTo')) {
      throw new BaseException(
          'Route config does not contain "component," "components," or "redirectTo"');
    }

    var recognizer: RouteRecognizer = MapWrapper.get(this._rules, parentComponent);

    if (isBlank(recognizer)) {
      recognizer = new RouteRecognizer();
      MapWrapper.set(this._rules, parentComponent, recognizer);
    }

    config = normalizeConfig(config);

    if (StringMapWrapper.contains(config, 'redirectTo')) {
      recognizer.addRedirect(config['path'], config['redirectTo']);
      return;
    }

    var components = config['components'];
    StringMapWrapper.forEach(components, (component, _) => this.configFromComponent(component));

    recognizer.addConfig(config['path'], config, config['as']);
  }
开发者ID:Mariem-07,项目名称:angular,代码行数:34,代码来源:route_registry.ts

示例4: _serializeParams

function _serializeParams(params: {[key: string]: string}): string {
  let res = "";
  if (isPresent(params)) {
    StringMapWrapper.forEach(params, (v, k) => res += `;${k}=${v}`);
  }
  return res;
}
开发者ID:844496869,项目名称:angular,代码行数:7,代码来源:segments.ts

示例5: _forEach

 _forEach(obj, fn) {
   if (obj instanceof Map) {
     MapWrapper.forEach(obj, fn);
   } else {
     StringMapWrapper.forEach(obj, fn);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:keyvalue_changes.ts

示例6: _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:kreo,项目名称:angular-2-bootstraping,代码行数:8,代码来源:form_builder.ts

示例7: constructor

 constructor({params, component, children, matchedUrl, parentSpecificity}: {
   params?: StringMap<string, any>,
   component?: any,
   children?: StringMap<string, Instruction>,
   matchedUrl?: string,
   parentSpecificity?: number
 } = {}) {
   this.reuse = false;
   this.capturedUrl = matchedUrl;
   this.accumulatedUrl = matchedUrl;
   this.specificity = parentSpecificity;
   if (isPresent(children)) {
     this._children = children;
     var childUrl;
     StringMapWrapper.forEach(this._children, (child, _) => {
       childUrl = child.accumulatedUrl;
       this.specificity += child.specificity;
     });
     if (isPresent(childUrl)) {
       this.accumulatedUrl += childUrl;
     }
   } else {
     this._children = StringMapWrapper.create();
   }
   this.component = component;
   this.params = params;
 }
开发者ID:Mariem-07,项目名称:angular,代码行数:27,代码来源:instruction.ts

示例8: _reduceControls

 _reduceControls(controlsConfig) {
   var controls = {};
   StringMapWrapper.forEach(controlsConfig, (controlConfig, controlName) => {
     controls[controlName] = this._createControl(controlConfig);
   });
   return controls;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:7,代码来源:form_builder.ts

示例9: describe

 describe(): StringMap<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) {
     res['meanFrameTime'] = this._perfLogFeatures.frameCapture ?
                                'mean frame time in ms (target: 16.6ms for 60fps)' :
                                'WARNING: Metric requested, but not supported by driver';
   }
   StringMapWrapper.forEach(this._microMetrics,
                            (desc, name) => { StringMapWrapper.set(res, name, desc); });
   return res;
 }
开发者ID:B-Thapa,项目名称:angular,代码行数:26,代码来源:perflog_metric.ts

示例10: _mergeErrors

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


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