本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例5:
modifierKeys.forEach(modifierName => {
if (ListWrapper.contains(parts, modifierName)) {
ListWrapper.remove(parts, modifierName);
fullKey += modifierName + '.';
}
});
示例6:
var hasCategories = ListWrapper.reduce(expectedCategories, (value, cat) => {
return value && ListWrapper.contains(eventCategories, cat);
}, true);