本文整理汇总了TypeScript中angular2/src/facade/collection.ListWrapper.forEach方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ListWrapper.forEach方法的具体用法?TypeScript ListWrapper.forEach怎么用?TypeScript ListWrapper.forEach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/collection.ListWrapper
的用法示例。
在下文中一共展示了ListWrapper.forEach方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
MapWrapper.forEach(this.paramsMap, (values, k) => {
ListWrapper.forEach(values, v => { paramsList.push(k + '=' + v); });
});
示例2: _createRecords
_createRecords(definition: ChangeDetectorDefinition) {
var recordBuilder = new ProtoRecordBuilder();
ListWrapper.forEach(definition.bindingRecords,
(b) => { recordBuilder.add(b, definition.variableNames); });
return coalesce(recordBuilder.records);
}
示例3: insertAllBefore
insertAllBefore(el, nodes) {
ListWrapper.forEach(nodes, (n) => { this.insertBefore(el, n); });
}
示例4: notify
/** Notify other nadio buttons that selection for the given name has been set. */
notify(name: string) {
ListWrapper.forEach(this.listeners_, (f) => f(name));
}
示例5: _setParentForControls
_setParentForControls() {
ListWrapper.forEach(this.controls, (control) => {
control.setParent(this);
});
}
示例6: createSteps
createSteps(viewDef, subTaskPromises) {
this.viewDef = viewDef;
this.subTaskPromises = subTaskPromises;
ListWrapper.forEach(this.subTaskPromises, (p) => ListWrapper.push(subTaskPromises, p));
return this.steps;
}
示例7: resultIdLog
function resultIdLog(result) {
var idLog = [];
ListWrapper.forEach(result, (current) => { logEntry(idLog, null, current); });
return idLog;
}
示例8: _createView
_createView(protoView) {
var rootElementClone = protoView.isRootView ? protoView.element : DOM.importIntoDoc(protoView.element);
var elementsWithBindingsDynamic;
if (protoView.isTemplateElement) {
elementsWithBindingsDynamic = DOM.querySelectorAll(DOM.content(rootElementClone), NG_BINDING_CLASS_SELECTOR);
} else {
elementsWithBindingsDynamic = DOM.getElementsByClassName(rootElementClone, NG_BINDING_CLASS);
}
var elementsWithBindings = ListWrapper.createFixedSize(elementsWithBindingsDynamic.length);
for (var binderIdx = 0; binderIdx < elementsWithBindingsDynamic.length; ++binderIdx) {
elementsWithBindings[binderIdx] = elementsWithBindingsDynamic[binderIdx];
}
var viewRootNodes;
if (protoView.isTemplateElement) {
var childNode = DOM.firstChild(DOM.content(rootElementClone));
viewRootNodes = [];
while (childNode != null) {
ListWrapper.push(viewRootNodes, childNode);
childNode = DOM.nextSibling(childNode);
}
} else {
viewRootNodes = [rootElementClone];
}
var binders = protoView.elementBinders;
var boundTextNodes = [];
var boundElements = ListWrapper.createFixedSize(binders.length);
var viewContainers = ListWrapper.createFixedSize(binders.length);
var contentTags = ListWrapper.createFixedSize(binders.length);
for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) {
var binder = binders[binderIdx];
var element;
if (binderIdx === 0 && protoView.rootBindingOffset === 1) {
element = rootElementClone;
} else {
element = elementsWithBindings[binderIdx - protoView.rootBindingOffset];
}
boundElements[binderIdx] = element;
var childNodes = DOM.childNodes(DOM.templateAwareRoot(element));
var textNodeIndices = binder.textNodeIndices;
for (var i = 0; i < textNodeIndices.length; i++) {
ListWrapper.push(boundTextNodes, childNodes[textNodeIndices[i]]);
}
var viewContainer = null;
if (isBlank(binder.componentId) && isPresent(binder.nestedProtoView)) {
viewContainer = new ViewContainer(this, element);
}
viewContainers[binderIdx] = viewContainer;
var contentTag = null;
if (isPresent(binder.contentTagSelector)) {
contentTag = new Content(element, binder.contentTagSelector);
}
contentTags[binderIdx] = contentTag;
}
var view = new View(protoView, viewRootNodes, boundTextNodes, boundElements, viewContainers, contentTags);
for (var binderIdx = 0; binderIdx < binders.length; binderIdx++) {
var binder = binders[binderIdx];
var element = boundElements[binderIdx];
if (isPresent(binder.componentId) && isPresent(binder.nestedProtoView)) {
var childView = this._createView(binder.nestedProtoView);
view.setComponentView(this._shadowDomStrategy, binderIdx, childView);
}
if (isPresent(binder.eventLocals)) {
ListWrapper.forEach(binder.eventNames, (eventName) => {
this._createEventListener(view, element, binderIdx, eventName, binder.eventLocals);
});
}
}
if (protoView.isRootView) {
view.hydrate(null);
}
return view;
}