本文整理汇总了TypeScript中angular2/src/facade/collection.MapWrapper.contains方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MapWrapper.contains方法的具体用法?TypeScript MapWrapper.contains怎么用?TypeScript MapWrapper.contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.MapWrapper
的用法示例。
在下文中一共展示了MapWrapper.contains方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should delegate event bindings to the first plugin supporting the event', () => {
var element = el('<div></div>');
var clickHandler = (e) => e;
var dblClickHandler = (e) => e;
var plugin1 = new FakeEventManagerPlugin(['dblclick']);
var plugin2 = new FakeEventManagerPlugin(['click', 'dblclick']);
var manager = new EventManager([plugin1, plugin2], new FakeNgZone());
manager.addEventListener(element, 'click', clickHandler);
manager.addEventListener(element, 'dblclick', dblClickHandler);
expect(MapWrapper.contains(plugin1._nonBubbleEventHandlers, 'click')).toBe(false);
expect(MapWrapper.get(plugin2._nonBubbleEventHandlers, 'click')).toBe(clickHandler);
expect(MapWrapper.contains(plugin2._nonBubbleEventHandlers, 'dblclick')).toBe(false);
expect(MapWrapper.get(plugin1._nonBubbleEventHandlers, 'dblclick')).toBe(dblClickHandler);
});
示例2: set
set(name, value) {
if (MapWrapper.contains(this.current, name)) {
MapWrapper.set(this.current, name, value);
} else {
throw new BaseException('Setting of new keys post-construction is not supported.');
}
}
示例3: parameters
parameters(typeOfFunc) {
if (MapWrapper.contains(this._typeInfo, typeOfFunc)) {
return MapWrapper.get(this._typeInfo, typeOfFunc)["parameters"];
} else {
return this.reflectionCapabilities.parameters(typeOfFunc);
}
}
示例4: annotations
annotations(typeOfFunc): List<any> {
if (MapWrapper.contains(this._typeInfo, typeOfFunc)) {
return MapWrapper.get(this._typeInfo, typeOfFunc)["annotations"];
} else {
return this.reflectionCapabilities.annotations(typeOfFunc);
}
}
示例5: factory
factory(type: Type): Function {
if (MapWrapper.contains(this._typeInfo, type)) {
return MapWrapper.get(this._typeInfo, type)["factory"];
} else {
return this.reflectionCapabilities.factory(type);
}
}
示例6: setter
setter(name: string): SetterFn {
if (MapWrapper.contains(this._setters, name)) {
return MapWrapper.get(this._setters, name);
} else {
return this.reflectionCapabilities.setter(name);
}
}
示例7: method
method(name: string): MethodFn {
if (MapWrapper.contains(this._methods, name)) {
return MapWrapper.get(this._methods, name);
} else {
return this.reflectionCapabilities.method(name);
}
}
示例8: getter
getter(name) {
if (MapWrapper.contains(this._getters, name)) {
return MapWrapper.get(this._getters, name);
} else {
return this.reflectionCapabilities.getter(name);
}
}
示例9: annotations
annotations(typeOrFunc): List<any> {
if (MapWrapper.contains(this._typeInfo, typeOrFunc)) {
return this._getTypeInfoField(typeOrFunc, "annotations", []);
} else {
return this.reflectionCapabilities.annotations(typeOrFunc);
}
}
示例10: interfaces
interfaces(type): List<any> {
if (MapWrapper.contains(this._typeInfo, type)) {
return this._getTypeInfoField(type, "interfaces", []);
} else {
return this.reflectionCapabilities.interfaces(type);
}
}