本文整理汇总了TypeScript中angular2/src/facade/collection.MapWrapper.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MapWrapper.get方法的具体用法?TypeScript MapWrapper.get怎么用?TypeScript MapWrapper.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.MapWrapper
的用法示例。
在下文中一共展示了MapWrapper.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _checkOverrideable
/**
* Once a component has been compiled, the AppProtoView is stored in the compiler cache.
*
* Then it should not be possible to override the component configuration after the component
* has been compiled.
*
* @param {Type} component
*/
_checkOverrideable(component: Type): void {
var cached = MapWrapper.get(this._viewCache, component);
if (isPresent(cached)) {
throw new BaseException(
`The component ${stringify(component)} has already been compiled, its configuration can not be changed`);
}
}
示例2: getComponentId
export function getComponentId(componentStringId) {
var id = MapWrapper.get(_componentUIDs, componentStringId);
if (isBlank(id)) {
id = _nextComponentUID++;
MapWrapper.set(_componentUIDs, componentStringId, id);
}
return id;
}
示例3:
ListWrapper.forEach(params, (param: string) => {
var split: List<string> = StringWrapper.split(param, '=');
var key = ListWrapper.get(split, 0);
var val = ListWrapper.get(split, 1);
var list = MapWrapper.get(map, key) || ListWrapper.create();
ListWrapper.push(list, val);
MapWrapper.set(map, key, list);
});
示例4: resolve
resolve(component) {
var template = MapWrapper.get(this._cache, component);
if (isBlank(template)) {
template = this._resolve(component);
MapWrapper.set(this._cache, component, template);
}
return template;
}
示例5: _registerViewContainer
_registerViewContainer(value, container) {
var containers = MapWrapper.get(this._valueViewContainers, value);
if (isBlank(containers)) {
containers = ListWrapper.create();
MapWrapper.set(this._valueViewContainers, value, containers);
}
ListWrapper.push(containers, container);
}
示例6: get
get(url: string): Promise<string> {
var response = MapWrapper.get(this._responses, url);
if (isBlank(response)) {
return PromiseWrapper.reject('xhr error', null);
}
return PromiseWrapper.resolve(response);
}
示例7: _addPartial
_addPartial(map, name) {
var matcher = MapWrapper.get(map, name);
if (isBlank(matcher)) {
matcher = new SelectorMatcher();
MapWrapper.set(map, name, matcher);
}
return matcher;
}
示例8: setLocal
setLocal(contextName: string, value): void {
if (!this.hydrated()) throw new BaseException('Cannot set locals on dehydrated view.');
if (!MapWrapper.contains(this.proto.variableBindings, contextName)) {
return;
}
var templateName = MapWrapper.get(this.proto.variableBindings, contextName);
this.locals.set(templateName, value);
}
示例9: _addTerminal
_addTerminal(map, name, selectable) {
var terminalList = MapWrapper.get(map, name);
if (isBlank(terminalList)) {
terminalList = ListWrapper.create();
MapWrapper.set(map, name, terminalList);
}
ListWrapper.push(terminalList, selectable);
}
示例10: put
put(record) {
var key = getMapKey(record.item);
var duplicates = MapWrapper.get(this.map, key);
if (!isPresent(duplicates)) {
duplicates = new _DuplicateItemRecordList();
MapWrapper.set(this.map, key, duplicates);
}
duplicates.add(record);
}