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