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


TypeScript ListWrapper.removeAt方法代码示例

本文整理汇总了TypeScript中angular2/src/core/facade/collection.ListWrapper.removeAt方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ListWrapper.removeAt方法的具体用法?TypeScript ListWrapper.removeAt怎么用?TypeScript ListWrapper.removeAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular2/src/core/facade/collection.ListWrapper的用法示例。


在下文中一共展示了ListWrapper.removeAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: parseEventName

  static parseEventName(eventName: string): StringMap<string, string> {
    var parts = eventName.toLowerCase().split('.');

    var domEventName = ListWrapper.removeAt(parts, 0);
    if ((parts.length === 0) ||
        !(StringWrapper.equals(domEventName, 'keydown') ||
          StringWrapper.equals(domEventName, 'keyup'))) {
      return null;
    }

    var key = KeyEventsPlugin._normalizeKey(ListWrapper.removeLast(parts));

    var fullKey = '';
    ListWrapper.forEach(modifierKeys, (modifierName) => {
      if (ListWrapper.contains(parts, modifierName)) {
        ListWrapper.remove(parts, modifierName);
        fullKey += modifierName + '.';
      }
    });
    fullKey += key;

    if (parts.length != 0 || key.length === 0) {
      // returning null instead of throwing to let another plugin process the event
      return null;
    }
    var result = StringMapWrapper.create();
    StringMapWrapper.set(result, 'domEventName', domEventName);
    StringMapWrapper.set(result, 'fullKey', fullKey);
    return result;
  }
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:30,代码来源:key_events.ts

示例2: detachViewInContainer

  detachViewInContainer(parentView: viewModule.AppView, boundElementIndex: number, index: number) {
    var viewContainer = parentView.viewContainers[boundElementIndex];
    var view = viewContainer.views[index];

    parentView.elementInjectors[boundElementIndex].traverseAndSetQueriesAsDirty();

    view.changeDetector.remove();
    ListWrapper.removeAt(viewContainer.views, index);
    for (var i = 0; i < view.rootElementInjectors.length; ++i) {
      var inj = view.rootElementInjectors[i];
      inj.unlink();
    }
  }
开发者ID:beta3000,项目名称:hola-angular2,代码行数:13,代码来源:view_manager_utils.ts

示例3: it

      it('should support duplicates', () => {
        let l = ['a', 'a', 'a', 'b', 'b'];
        differ.check(l);

        ListWrapper.removeAt(l, 0);
        differ.check(l);
        expect(differ.toString())
            .toEqual(iterableChangesAsString({
              collection: ['a', 'a', 'b[3->2]', 'b[4->3]'],
              previous: ['a', 'a', 'a[2->null]', 'b[3->2]', 'b[4->3]'],
              moves: ['b[3->2]', 'b[4->3]'],
              removals: ['a[2->null]']
            }));
      });
开发者ID:hankduan,项目名称:angular,代码行数:14,代码来源:default_iterable_differ_spec.ts

示例4: _removeDotSegments

/**
  * Removes dot segments in given path component, as described in
  * RFC 3986, section 5.2.4.
  *
  * @param {string} path A non-empty path component.
  * @return {string} Path component with removed dot segments.
  */
function _removeDotSegments(path: string): string {
  if (path == '/') return '/';

  var leadingSlash = path[0] == '/' ? '/' : '';
  var trailingSlash = path[path.length - 1] === '/' ? '/' : '';
  var segments = path.split('/');

  var out = [];
  var up = 0;
  for (var pos = 0; pos < segments.length; pos++) {
    var segment = segments[pos];
    switch (segment) {
      case '':
      case '.':
        break;
      case '..':
        if (out.length > 0) {
          ListWrapper.removeAt(out, out.length - 1);
        } else {
          up++;
        }
        break;
      default:
        out.push(segment);
    }
  }

  if (leadingSlash == '') {
    while (up-- > 0) {
      ListWrapper.insert(out, 0, '..');
    }

    if (out.length === 0) out.push('.');
  }

  return leadingSlash + out.join('/') + trailingSlash;
}
开发者ID:chiragjraval,项目名称:AdvisroySystemPOC,代码行数:44,代码来源:url_resolver.ts


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