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


TypeScript ListWrapper.isEmpty方法代码示例

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

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

示例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 '';
  }
开发者ID:Konviser,项目名称:todo-list,代码行数:12,代码来源:change_detection_jit_generator.ts

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

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

示例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}`;
 }
开发者ID:synaptek,项目名称:angular,代码行数:24,代码来源:codegen_name_util.ts

示例7: insert

 insert(nodes) {
   this.nodes = nodes;
   DOM.insertAllBefore(this.endScript, nodes);
   this._removeNodesUntil(ListWrapper.isEmpty(nodes) ? this.endScript : nodes[0]);
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:5,代码来源:content_tag.ts

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

示例9: pop

 pop() {
   return ListWrapper.isEmpty(this._views) ? null : ListWrapper.removeLast(this._views);
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:3,代码来源:view_pool.ts


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