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


TypeScript MapWrapper.delete方法代码示例

本文整理汇总了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;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:8,代码来源:iterable_changes.ts

示例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);
 }
开发者ID:Salim-K,项目名称:angular,代码行数:10,代码来源:common.ts

示例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);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:10,代码来源:switch.ts

示例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;
 });
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:11,代码来源:compiler.ts

示例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);
   }
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:18,代码来源:keyvalue_changes.ts

示例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]']}));
      });
开发者ID:SnackyPete,项目名称:angular,代码行数:40,代码来源:keyvalue_changes_spec.ts

示例7: delete

 delete (param): void { MapWrapper.delete(this.paramsMap, param); }
开发者ID:Salim-K,项目名称:angular,代码行数:1,代码来源:url_search_params.ts

示例8: return

 return () => {
   MapWrapper.delete(
       shouldSupportBubble ? this._bubbleEventHandlers : this._nonBubbleEventHandlers, eventName)
 };
开发者ID:188799958,项目名称:angular,代码行数:4,代码来源:event_manager_spec.ts

示例9: viewDestroyed

 viewDestroyed(view: AppView) {
   var viewId = MapWrapper.get(_allIdsByView, view);
   MapWrapper.delete(_allIdsByView, view);
   MapWrapper.delete(_allViewsById, viewId);
 }
开发者ID:MiisterPatate,项目名称:planning,代码行数:5,代码来源:debug_element_view_listener.ts

示例10:

 MapWrapper.forEach(this._outlets, (outlet, outletName) => {
   if (!instruction.hasChild(outletName)) {
     MapWrapper.delete(this._outlets, outletName);
     ListWrapper.push(toDeactivate, outlet);
   }
 });
开发者ID:Mariem-07,项目名称:angular,代码行数:6,代码来源:router.ts


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