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


TypeScript StringMapWrapper.merge方法代码示例

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


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

示例1: config

  /**
   * Given a component and a configuration object, add the route to this registry
   */
  config(parentComponent, config: StringMap<string, any>): void {
    assertValidConfig(config);

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

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

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

    config = StringMapWrapper.merge(
        config, {'component': normalizeComponentDeclaration(config['component'])});

    var component = config['component'];
    var terminal = recognizer.addConfig(config['path'], config, config['as']);

    if (component['type'] == 'constructor') {
      if (terminal) {
        assertTerminalComponent(component['constructor'], config['path']);
      } else {
        this.configFromComponent(component['constructor']);
      }
    }
  }
开发者ID:Salim-K,项目名称:angular,代码行数:32,代码来源:route_registry.ts

示例2: _createInnerZone

 _createInnerZone(zone, enableLongStackTrace) {
   var vmTurnZone = this;
   var errorHandling;
   if (enableLongStackTrace) {
     errorHandling = StringMapWrapper.merge(Zone.longStackTraceZone, {onError: function(e) {
         vmTurnZone._onError(this, e);
       }});
   } else {
     errorHandling = {onError: function(e) {
         vmTurnZone._onError(this, e);
       }};
   }
   return zone.fork(errorHandling).fork({
     beforeTask: () => {
       this._beforeTask();
     },
     afterTask: () => {
       this._afterTask();
     }
   });
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:21,代码来源:vm_turn_zone.ts

示例3: config

  /**
   * Given a component and a configuration object, add the route to this registry
   */
  config(parentComponent, config: StringMap<string, any>): void {
    assertValidConfig(config);

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

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

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

    config = StringMapWrapper.merge(
        config, {'component': normalizeComponentDeclaration(config['component'])});

    var component = config['component'];
    this.configFromComponent(component);

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

示例4: validator

 var res = ListWrapper.reduce(validators, (res, validator) => {
   var errors = validator(c);
   return isPresent(errors) ? StringMapWrapper.merge(res, errors) : res;
 }, {});
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:4,代码来源:validators.ts

示例5: isPresent

 arrayOfErrors.reduce((res: {[key: string]: any}, errors: {[key: string]: any}) => {
   return isPresent(errors) ? StringMapWrapper.merge(res, errors) : res;
 }, {});
开发者ID:JavaScript-Resource,项目名称:angular,代码行数:3,代码来源:validators.ts


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