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


TypeScript ListWrapper.createFixedSize方法代码示例

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


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

示例1: constructor

  constructor(private changeControlStrategy: string, private dispatcher: any,
              private pipeRegistry: PipeRegistry, private protos: List<ProtoRecord>,
              private directiveRecords: List<any>) {
    super();
    this.values = ListWrapper.createFixedSize(protos.length + 1);
    this.pipes = ListWrapper.createFixedSize(protos.length + 1);
    this.prevContexts = ListWrapper.createFixedSize(protos.length + 1);
    this.changes = ListWrapper.createFixedSize(protos.length + 1);

    ListWrapper.fill(this.values, uninitialized);
    ListWrapper.fill(this.pipes, null);
    ListWrapper.fill(this.prevContexts, uninitialized);
    ListWrapper.fill(this.changes, false);
    this.locals = null;
    this.directives = null;
  }
开发者ID:188799958,项目名称:angular,代码行数:16,代码来源:dynamic_change_detector.ts

示例2: _visitAll

 _visitAll(asts: List<any>) {
   var res = ListWrapper.createFixedSize(asts.length);
   for (var i = 0; i < asts.length; ++i) {
     res[i] = asts[i].visit(this);
   }
   return res;
 }
开发者ID:AsherBarak,项目名称:angular,代码行数:7,代码来源:proto_change_detector.ts

示例3: main

export function main() {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  var size = getIntParameter('size');
  testList = ListWrapper.createFixedSize(size);

  bootstrap(AppComponent)
      .then((ref) => {
        var injector = ref.injector;
        var app: AppComponent = injector.get(AppComponent);
        var lifeCycle = injector.get(LifeCycle);

        bindAction('#reset', function() {
          app.reset();
          lifeCycle.tick();
        });

        // Baseline (plain components)
        bindAction('#createPlainComponents', function() {
          app.createPlainComponents();
          lifeCycle.tick();
        });

        // Components with decorators
        bindAction('#createComponentsWithDirectives', function() {
          app.createComponentsWithDirectives();
          lifeCycle.tick();
        });

        // Components with decorators
        bindAction('#createDynamicComponents', function() {
          app.createDynamicComponents();
          lifeCycle.tick();
        });
      });
}
开发者ID:Salim-K,项目名称:angular,代码行数:35,代码来源:index.ts

示例4: createAppProtoViews

 createAppProtoViews(hostComponentBinding: DirectiveBinding,
                     rootRenderProtoView: renderApi.ProtoViewDto,
                     allDirectives: List<DirectiveBinding>): List<AppProtoView> {
   var allRenderDirectiveMetadata =
       ListWrapper.map(allDirectives, directiveBinding => directiveBinding.metadata);
   var nestedPvsWithIndex = _collectNestedProtoViews(rootRenderProtoView);
   var nestedPvVariableBindings = _collectNestedProtoViewsVariableBindings(nestedPvsWithIndex);
   var nestedPvVariableNames =
       _collectNestedProtoViewsVariableNames(nestedPvsWithIndex, nestedPvVariableBindings);
   var changeDetectorDefs =
       _getChangeDetectorDefinitions(hostComponentBinding.metadata, nestedPvsWithIndex,
                                     nestedPvVariableNames, allRenderDirectiveMetadata);
   var protoChangeDetectors = ListWrapper.map(
       changeDetectorDefs,
       changeDetectorDef => this._changeDetection.createProtoChangeDetector(changeDetectorDef));
   var appProtoViews = ListWrapper.createFixedSize(nestedPvsWithIndex.length);
   ListWrapper.forEach(nestedPvsWithIndex, (pvWithIndex) => {
     var appProtoView =
         _createAppProtoView(pvWithIndex.renderProtoView, protoChangeDetectors[pvWithIndex.index],
                             nestedPvVariableBindings[pvWithIndex.index], allDirectives);
     if (isPresent(pvWithIndex.parentIndex)) {
       var parentView = appProtoViews[pvWithIndex.parentIndex];
       parentView.elementBinders[pvWithIndex.boundElementIndex].nestedProtoView = appProtoView;
     }
     appProtoViews[pvWithIndex.index] = appProtoView;
   });
   return appProtoViews;
 }
开发者ID:SnackyPete,项目名称:angular,代码行数:28,代码来源:proto_view_factory.ts

示例5: main

export function main() {
  var size = getIntParameter('size');
  testList = ListWrapper.createFixedSize(size);

  bootstrap(AppComponent)
      .then((ref) => {
        var injector = ref.injector;
        var app: AppComponent = ref.hostComponent;
        var appRef = injector.get(ApplicationRef);

        bindAction('#reset', function() {
          app.reset();
          appRef.tick();
        });

        // Baseline (plain components)
        bindAction('#createPlainComponents', function() {
          app.createPlainComponents();
          appRef.tick();
        });

        // Components with decorators
        bindAction('#createComponentsWithDirectives', function() {
          app.createComponentsWithDirectives();
          appRef.tick();
        });

        // Components with decorators
        bindAction('#createDynamicComponents', function() {
          app.createDynamicComponents();
          appRef.tick();
        });
      });
}
开发者ID:ASLA1899,项目名称:angular,代码行数:34,代码来源:index.ts

示例6: _readArgs

 _readArgs(proto: ProtoRecord) {
   var res = ListWrapper.createFixedSize(proto.args.length);
   var args = proto.args;
   for (var i = 0; i < args.length; ++i) {
     res[i] = this.values[args[i]];
   }
   return res;
 }
开发者ID:Dineshchse,项目名称:angular,代码行数:8,代码来源:dynamic_change_detector.ts

示例7: createView

 function createView(pv = null, renderViewRef = null) {
   if (isBlank(pv)) {
     pv = createProtoView();
   }
   if (isBlank(renderViewRef)) {
     renderViewRef = new RenderViewRef();
   }
   var view = new AppView(renderer, pv, MapWrapper.create());
   view.render = renderViewRef;
   var elementInjectors = ListWrapper.createFixedSize(pv.elementBinders.length);
   for (var i = 0; i < pv.elementBinders.length; i++) {
     elementInjectors[i] = createElementInjector();
   }
   view.init(null, elementInjectors, [], ListWrapper.createFixedSize(pv.elementBinders.length),
             ListWrapper.createFixedSize(pv.elementBinders.length));
   return view;
 }
开发者ID:SnackyPete,项目名称:angular,代码行数:17,代码来源:view_manager_spec.ts

示例8: childNodesAsList

 childNodesAsList(el): List<any> {
   var childNodes = el.childNodes;
   var res = ListWrapper.createFixedSize(childNodes.length);
   for (var i = 0; i < childNodes.length; i++) {
     res[i] = childNodes[i];
   }
   return res;
 }
开发者ID:CADBOT,项目名称:angular,代码行数:8,代码来源:parse5_adapter.ts

示例9: constructor

 constructor(private records: List<ProtoRecord>, private directiveRecords: List<any>,
             private utilName: string) {
   this._sanitizedNames = ListWrapper.createFixedSize(this.records.length + 1);
   this._sanitizedNames[CONTEXT_INDEX] = _CONTEXT_ACCESSOR;
   for (var i = 0, iLen = this.records.length; i < iLen; ++i) {
     this._sanitizedNames[i + 1] = sanitizeName(`${this.records[i].name}${i}`);
   }
 }
开发者ID:goderbauer,项目名称:angular,代码行数:8,代码来源:codegen_name_util.ts

示例10: constructor

 constructor(changeControlStrategy, dispatcher, pipeRegistry, protoRecords, directiveMementos) {
   super();
   this.dispatcher = dispatcher;
   this.pipeRegistry = pipeRegistry;
   this.values = ListWrapper.createFixedSize(protoRecords.length + 1);
   this.pipes = ListWrapper.createFixedSize(protoRecords.length + 1);
   this.prevContexts = ListWrapper.createFixedSize(protoRecords.length + 1);
   this.changes = ListWrapper.createFixedSize(protoRecords.length + 1);
   ListWrapper.fill(this.values, uninitialized);
   ListWrapper.fill(this.pipes, null);
   ListWrapper.fill(this.prevContexts, uninitialized);
   ListWrapper.fill(this.changes, false);
   this.locals = null;
   this.protos = protoRecords;
   this.directiveMementos = directiveMementos;
   this.changeControlStrategy = changeControlStrategy;
 }
开发者ID:gdi2290,项目名称:sample-Angular2,代码行数:17,代码来源:dynamic_change_detector.ts


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