本文整理汇总了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;
}
示例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;
}
示例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();
});
});
}
示例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;
}
示例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();
});
});
}
示例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;
}
示例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;
}
示例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;
}
示例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}`);
}
}
示例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;
}