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


TypeScript StringMapWrapper.get方法代码示例

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


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

示例1: group

 /**
  * Construct a new {@link ControlGroup} with the given map of configuration.
  * Valid keys for the `extra` parameter map are `optionals` and `validator`.
  *
  * See the {@link ControlGroup} constructor for more details.
  */
 group(controlsConfig: {[key: string]: any},
       extra: {[key: string]: any} = null): modelModule.ControlGroup {
   var controls = this._reduceControls(controlsConfig);
   var optionals = isPresent(extra) ? StringMapWrapper.get(extra, "optionals") : null;
   var validator = isPresent(extra) ? StringMapWrapper.get(extra, "validator") : null;
   var asyncValidator = isPresent(extra) ? StringMapWrapper.get(extra, "asyncValidator") : null;
   return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator);
 }
开发者ID:kreo,项目名称:angular-2-bootstraping,代码行数:14,代码来源:form_builder.ts

示例2: group

 group(controlsConfig, extra = null) {
   var controls = this._reduceControls(controlsConfig);
   var optionals = isPresent(extra) ? StringMapWrapper.get(extra, "optionals") : null;
   var validator = isPresent(extra) ? StringMapWrapper.get(extra, "validator") : null;
   if (isPresent(validator)) {
     return new modelModule.ControlGroup(controls, optionals, validator);
   } else {
     return new modelModule.ControlGroup(controls, optionals);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:10,代码来源:form_builder.ts

示例3: 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

示例4: createProtoChangeDetector

 createProtoChangeDetector(definition: ChangeDetectorDefinition): ProtoChangeDetector {
   var id = definition.id;
   if (StringMapWrapper.contains(this._protoChangeDetectors, id)) {
     return StringMapWrapper.get(this._protoChangeDetectors, id)(this.registry);
   }
   return this._dynamicChangeDetection.createProtoChangeDetector(definition);
 }
开发者ID:baraksu,项目名称:angular,代码行数:7,代码来源:change_detection.ts

示例5: load

  load(template: ViewDefinition): Promise</*element*/ any> {
    if (isPresent(template.template)) {
      return PromiseWrapper.resolve(DOM.createTemplate(template.template));
    }
    var url = template.absUrl;
    if (isPresent(url)) {
      var promise = StringMapWrapper.get(this._htmlCache, url);

      if (isBlank(promise)) {
        // TODO(vicb): change error when TS gets fixed
        // https://github.com/angular/angular/issues/2280
        // throw new BaseException(`Failed to fetch url "${url}"`);
        promise = PromiseWrapper.then(this._xhr.get(url), html => {
          var template = DOM.createTemplate(html);
          return template;
        }, _ => PromiseWrapper.reject(new BaseException(`Failed to fetch url "${url}"`), null));

        StringMapWrapper.set(this._htmlCache, url, promise);
      }

      // We need to clone the result as others might change it
      // (e.g. the compiler).
      return promise.then((tplElement) => DOM.clone(tplElement));
    }

    throw new BaseException('View should have either the url or template property set');
  }
开发者ID:B-Thapa,项目名称:angular,代码行数:27,代码来源:template_loader.ts

示例6: generate

 generate(params: StringMap<string, string>): string {
   if (!StringMapWrapper.contains(params, this.name)) {
     throw new BaseException(
         `Route generator for '${this.name}' was not included in parameters passed.`)
   }
   return normalizeBlank(StringMapWrapper.get(params, this.name));
 }
开发者ID:AsherBarak,项目名称:angular,代码行数:7,代码来源:path_recognizer.ts

示例7:

 ListWrapper.forEach(modifierKeys, (modifierName) => {
   if (modifierName != key) {
     var modifierGetter = StringMapWrapper.get(modifierKeyGetters, modifierName);
     if (modifierGetter(event)) {
       fullKey += modifierName + '.';
     }
   }
 });
开发者ID:AsherBarak,项目名称:angular,代码行数:8,代码来源:key_events.ts

示例8: triggerEventHandlers

 triggerEventHandlers(eventName, eventObj, binderIndex) {
   var handlers = this.proto.eventHandlers[binderIndex];
   if (isBlank(handlers))
     return ;
   var handler = StringMapWrapper.get(handlers, eventName);
   if (isBlank(handler))
     return ;
   handler(eventObj, this);
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:9,代码来源:view.ts

示例9: addEventListener

  addEventListener(element: HTMLElement, eventName: string, handler: (Event: any) => any) {
    var parsedEvent = KeyEventsPlugin.parseEventName(eventName);

    var outsideHandler = KeyEventsPlugin.eventCallback(
        element, StringMapWrapper.get(parsedEvent, 'fullKey'), handler, this.manager.getZone());

    this.manager.getZone().runOutsideAngular(() => {
      DOM.on(element, StringMapWrapper.get(parsedEvent, 'domEventName'), outsideHandler);
    });
  }
开发者ID:MingXingTeam,项目名称:awesome-front-end,代码行数:10,代码来源:key_events.ts

示例10: create

  static create({id, selector, compileChildren, events, host, properties, readAttributes, type,
                 callOnDestroy, callOnChange, callOnCheck, callOnInit, callOnAllChangesDone,
                 changeDetection, exportAs}: {
    id?: string,
    selector?: string,
    compileChildren?: boolean,
    events?: List<string>,
    host?: Map<string, string>,
    properties?: List<string>,
    readAttributes?: List<string>,
    type?: number,
    callOnDestroy?: boolean,
    callOnChange?: boolean,
    callOnCheck?: boolean,
    callOnInit?: boolean,
    callOnAllChangesDone?: boolean,
    changeDetection?: string,
    exportAs?: string
  }) {
    let hostConfig = DirectiveMetadata.parseHostConfig(host);

    return new DirectiveMetadata({
      id: id,
      selector: selector,
      compileChildren: compileChildren,
      events: events,
      hostListeners: StringMapWrapper.get(hostConfig, 'hostListeners'),
      hostProperties: StringMapWrapper.get(hostConfig, 'hostProperties'),
      hostAttributes: StringMapWrapper.get(hostConfig, 'hostAttributes'),
      hostActions: StringMapWrapper.get(hostConfig, 'hostActions'),
      properties: properties,
      readAttributes: readAttributes,
      type: type,
      callOnDestroy: callOnDestroy,
      callOnChange: callOnChange,
      callOnCheck: callOnCheck,
      callOnInit: callOnInit,
      callOnAllChangesDone: callOnAllChangesDone,
      changeDetection: changeDetection,
      exportAs: exportAs
    });
  }
开发者ID:amzinino,项目名称:angular,代码行数:42,代码来源:api.ts


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