本文整理汇总了TypeScript中angular2/src/facade/collection.ListWrapper.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ListWrapper.isEmpty方法的具体用法?TypeScript ListWrapper.isEmpty怎么用?TypeScript ListWrapper.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.ListWrapper
的用法示例。
在下文中一共展示了ListWrapper.isEmpty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: addPipes
addPipes(bindingAst: ASTWithSource, pipes: List<string>): ASTWithSource {
if (ListWrapper.isEmpty(pipes)) return bindingAst;
var res: AST = ListWrapper.reduce(
pipes, (result, currentPipeName) => new Pipe(result, currentPipeName, [], false),
bindingAst.ast);
return new ASTWithSource(res, bindingAst.source, bindingAst.location);
}
示例2: genDehydrateFields
/**
* Generates statements which clear all fields so that the change detector is dehydrated.
*/
genDehydrateFields(): string {
var fields = this.getAllFieldNames();
ListWrapper.removeAt(fields, CONTEXT_INDEX);
if (ListWrapper.isEmpty(fields)) return '';
// At least one assignment.
fields.push(`${this.utilName}.uninitialized;`);
return ListWrapper.join(fields, ' = ');
}
示例3: _genEndOfSkipBlock
/** @internal */
_genEndOfSkipBlock(protoIndex: number): string {
if (!ListWrapper.isEmpty(this._endOfBlockIdxs)) {
let endOfBlock = ListWrapper.last(this._endOfBlockIdxs);
if (protoIndex === endOfBlock) {
this._endOfBlockIdxs.pop();
return '}';
}
}
return '';
}
示例4: addAst
addAst(ast, bindingMemento, directiveMemento = null, variableBindings = null) {
var last = ListWrapper.last(this.records);
if (isPresent(last) && last.directiveMemento == directiveMemento) {
last.lastInDirective = false;
}
var pr = _ConvertAstIntoProtoRecords.convert(ast, bindingMemento, directiveMemento, this.records.length, variableBindings);
if (!ListWrapper.isEmpty(pr)) {
var last = ListWrapper.last(pr);
last.lastInBinding = true;
last.lastInDirective = true;
this.records = ListWrapper.concat(this.records, pr);
}
}
示例5: addAst
addAst(b: BindingRecord, variableNames: List < string >= null) {
var last = ListWrapper.last(this.records);
if (isPresent(last) && last.bindingRecord.directiveRecord == b.directiveRecord) {
last.lastInDirective = false;
}
var pr = _ConvertAstIntoProtoRecords.convert(b, this.records.length, variableNames);
if (!ListWrapper.isEmpty(pr)) {
var last = ListWrapper.last(pr);
last.lastInBinding = true;
last.lastInDirective = true;
this.records = ListWrapper.concat(this.records, pr);
}
}
示例6: genInitLocals
/**
* Generate a statement initializing local variables used when detecting changes.
*/
genInitLocals(): string {
var declarations = [];
var assignments = [];
for (var i = 0, iLen = this.getFieldCount(); i < iLen; ++i) {
if (i == CONTEXT_INDEX) {
declarations.push(`${this.getLocalName(i)} = ${this.getFieldName(i)}`);
} else {
var rec = this.records[i - 1];
if (rec.argumentToPureFunction) {
var changeName = this.getChangeName(i);
declarations.push(`${this.getLocalName(i)},${changeName}`);
assignments.push(changeName);
} else {
declarations.push(`${this.getLocalName(i)}`);
}
}
}
var assignmentsCode =
ListWrapper.isEmpty(assignments) ? '' : `${ListWrapper.join(assignments, '=')} = false;`;
return `var ${ListWrapper.join(declarations, ',')};${assignmentsCode}`;
}
示例7: insert
insert(nodes) {
this.nodes = nodes;
DOM.insertAllBefore(this.endScript, nodes);
this._removeNodesUntil(ListWrapper.isEmpty(nodes) ? this.endScript : nodes[0]);
}
示例8:
var _addResult = (res, cssSel) => {
if (isPresent(cssSel.notSelector) && isBlank(cssSel.element) && ListWrapper.isEmpty(cssSel.classNames) && ListWrapper.isEmpty(cssSel.attrs)) {
cssSel.element = "*";
}
ListWrapper.push(res, cssSel);
};
示例9: pop
pop() {
return ListWrapper.isEmpty(this._views) ? null : ListWrapper.removeLast(this._views);
}