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


TypeScript ListWrapper.contains方法代码示例

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


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

示例1: visitPropertyRead

 visitPropertyRead(ast: PropertyRead): number {
   var receiver = ast.receiver.visit(this);
   if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name) &&
       ast.receiver instanceof ImplicitReceiver) {
     return this._addRecord(RecordType.Local, ast.name, ast.name, [], null, receiver);
   } else {
     return this._addRecord(RecordType.PropertyRead, ast.name, ast.getter, [], null, receiver);
   }
 }
开发者ID:hankduan,项目名称:angular,代码行数:9,代码来源:proto_change_detector.ts

示例2: visitMethodCall

 visitMethodCall(ast: MethodCall): number {
   var receiver = ast.receiver.visit(this);
   var args = this._visitAll(ast.args);
   if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name)) {
     var target = this._addRecord(RecordType.Local, ast.name, ast.name, [], null, receiver);
     return this._addRecord(RecordType.InvokeClosure, "closure", null, args, null, target);
   } else {
     return this._addRecord(RecordType.InvokeMethod, ast.name, ast.fn, args, null, receiver);
   }
 }
开发者ID:hankduan,项目名称:angular,代码行数:10,代码来源:proto_change_detector.ts

示例3: visitPropertyWrite

 visitPropertyWrite(ast: PropertyWrite): number {
   if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name) &&
       ast.receiver instanceof ImplicitReceiver) {
     throw new BaseException(`Cannot reassign a variable binding ${ast.name}`);
   } else {
     var receiver = ast.receiver.visit(this);
     var value = ast.value.visit(this);
     return this._addRecord(RecordType.PropertyWrite, ast.name, ast.setter, [value], null,
                            receiver);
   }
 }
开发者ID:hankduan,项目名称:angular,代码行数:11,代码来源:proto_change_detector.ts

示例4: findFirstClosedCycle

function findFirstClosedCycle(keys: any[]): any[] {
  var res = [];
  for (var i = 0; i < keys.length; ++i) {
    if (ListWrapper.contains(res, keys[i])) {
      res.push(keys[i]);
      return res;
    } else {
      res.push(keys[i]);
    }
  }
  return res;
}
开发者ID:beta3000,项目名称:hola-angular2,代码行数:12,代码来源:exceptions.ts

示例5:

 modifierKeys.forEach(modifierName => {
   if (ListWrapper.contains(parts, modifierName)) {
     ListWrapper.remove(parts, modifierName);
     fullKey += modifierName + '.';
   }
 });
开发者ID:beta3000,项目名称:hola-angular2,代码行数:6,代码来源:key_events.ts

示例6:

 var hasCategories = ListWrapper.reduce(expectedCategories, (value, cat) => {
   return value && ListWrapper.contains(eventCategories, cat);
 }, true);
开发者ID:hankduan,项目名称:angular,代码行数:3,代码来源:chrome_driver_extension.ts


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