本文整理汇总了TypeScript中angular2/src/facade/collection.MapWrapper.clear方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MapWrapper.clear方法的具体用法?TypeScript MapWrapper.clear怎么用?TypeScript MapWrapper.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.MapWrapper
的用法示例。
在下文中一共展示了MapWrapper.clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should do basic map watching', () => {
changes.check(m);
MapWrapper.set(m, 'a', 'A');
changes.check(m);
expect(changes.toString())
.toEqual(kvChangesAsString({map: ['a[null->A]'], additions: ['a[null->A]']}));
MapWrapper.set(m, 'b', 'B');
changes.check(m);
expect(changes.toString())
.toEqual(kvChangesAsString(
{map: ['a', 'b[null->B]'], previous: ['a'], additions: ['b[null->B]']}));
MapWrapper.set(m, 'b', 'BB');
MapWrapper.set(m, 'd', 'D');
changes.check(m);
expect(changes.toString())
.toEqual(kvChangesAsString({
map: ['a', 'b[B->BB]', 'd[null->D]'],
previous: ['a', 'b[B->BB]'],
additions: ['d[null->D]'],
changes: ['b[B->BB]']
}));
MapWrapper.delete(m, 'b');
changes.check(m);
expect(changes.toString())
.toEqual(kvChangesAsString({
map: ['a', 'd'],
previous: ['a', 'b[BB->null]', 'd'],
removals: ['b[BB->null]']
}));
MapWrapper.clear(m);
changes.check(m);
expect(changes.toString())
.toEqual(kvChangesAsString(
{previous: ['a[A->null]', 'd[D->null]'], removals: ['a[A->null]', 'd[D->null]']}));
});
示例2: clear
clear() {
MapWrapper.clear(this.map);
}
示例3: resetShadowDomCache
export function resetShadowDomCache() {
MapWrapper.clear(_componentUIDs);
_nextComponentUID = 0;
MapWrapper.clear(_sharedStyleTexts);
_lastInsertedStyleEl = null;
}
示例4: clear
clear() {
MapWrapper.clear(this._cache);
}