本文整理汇总了TypeScript中angular2/src/facade/collection.MapWrapper.delete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript MapWrapper.delete方法的具体用法?TypeScript MapWrapper.delete怎么用?TypeScript MapWrapper.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.MapWrapper
的用法示例。
在下文中一共展示了MapWrapper.delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: remove
remove(record) {
var key = getMapKey(record.item);
var recordList = MapWrapper.get(this.map, key);
if (recordList.remove(record)) {
MapWrapper.delete(this.map, key);
}
return record;
}
示例2: remove
remove(key: string) {
if (!key.contains('.')) {
return MapWrapper.delete(this._data, key);
}
var pieces = key.split('.');
var last = ListWrapper.last(pieces);
pieces.length = pieces.length - 1;
var target = _resolve(pieces, this);
return target.remove(last);
}
示例3: _deregisterViewContainer
_deregisterViewContainer(value, container) {
if (value == _whenDefault)
return ;
var containers = MapWrapper.get(this._valueViewContainers, value);
if (containers.length == 1) {
MapWrapper.delete(this._valueViewContainers, value);
} else {
ListWrapper.remove(containers, container);
}
}
示例4: BaseException
pvPromise = this._compileNoRecurse(componentBinding, template, directives).then((protoView) => {
this._compilerCache.set(component, protoView);
MapWrapper.delete(this._compiling, component);
var nestedPVPromises = this._compileNestedComponents(protoView);
if (nestedPVPromises.length > 0) {
return PromiseWrapper.then(PromiseWrapper.all(nestedPVPromises), (_) => protoView, (e) => {
throw new BaseException(`${e} -> Failed to compile ${stringify(component)}`);
});
}
return protoView;
});
示例5: _truncate
_truncate(lastRecord, record) {
while (record !== null) {
if (lastRecord === null) {
this._mapHead = null;
} else {
lastRecord._next = null;
}
var nextRecord = record._next;
this._addToRemovals(record);
lastRecord = record;
record = nextRecord;
}
for (var rec = this._removalsHead; rec !== null; rec = rec._nextRemoved) {
rec.previousValue = rec.currentValue;
rec.currentValue = null;
MapWrapper.delete(this._records, rec.key);
}
}
示例6: 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]']}));
});
示例7: delete
delete (param): void { MapWrapper.delete(this.paramsMap, param); }
示例8: return
return () => {
MapWrapper.delete(
shouldSupportBubble ? this._bubbleEventHandlers : this._nonBubbleEventHandlers, eventName)
};
示例9: viewDestroyed
viewDestroyed(view: AppView) {
var viewId = MapWrapper.get(_allIdsByView, view);
MapWrapper.delete(_allIdsByView, view);
MapWrapper.delete(_allViewsById, viewId);
}
示例10:
MapWrapper.forEach(this._outlets, (outlet, outletName) => {
if (!instruction.hasChild(outletName)) {
MapWrapper.delete(this._outlets, outletName);
ListWrapper.push(toDeactivate, outlet);
}
});