本文整理匯總了TypeScript中app/utils/resetChildren.resetChildren函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript resetChildren函數的具體用法?TypeScript resetChildren怎麽用?TypeScript resetChildren使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了resetChildren函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('can reset the children of a given DOM element', function() {
var container = createDOMElement('container');
var child = createDOMElement('child');
container.appendChild(child);
var aNewChild = createDOMElement('new-child');
var aWidget = new LabeledTextField('A field');
resetChildren(container, [aNewChild, aWidget]);
assert.equal(container.children.length, 2, 'has the appropriate number of children');
assert.equal(container.children[0].tagName, aNewChild.tagName, 'contains the new children only');
assert.equal(container.children[1].tagName, 'LABELED-TEXT-FIELD', 'contains the new children only');
});
示例2: function
this.setData = function(todoItemData) {
assert(Array.isArray(todoItemData), 'TodoList#setData expects the argument to be an array of objects');
items = createItems(todoItemData);
resetChildren(domElement, items);
};
示例3: function
this.setChildWidgets = function(childWidgets) {
resetChildren(domElement, [label].concat(childWidgets));
};
示例4: function
this.setChildWidgets = function(childWidgets) {
resetChildren(domElement, childWidgets);
};
示例5: setOptions
function setOptions(domElement, options) {
var optionButtons = _.map(options, createOptionButton);
resetChildren(domElement, optionButtons);
}
示例6: function
this.setDetailWidgets = function(detailWidgets) {
resetChildren(detailWidgetContainer, detailWidgets);
};