attachFutureElement method
void
attachFutureElement(
- DOMElement? domParent,
- T? parent,
- DOMNode domElement,
- T? templateElement,
- Object? futureElementResolved,
- DOMTreeMap<
T> treeMap, - DOMContext<
T> ? context,
Implementation
void attachFutureElement(
DOMElement? domParent,
T? parent,
DOMNode domElement,
T? templateElement,
Object? futureElementResolved,
DOMTreeMap<T> treeMap,
DOMContext<T>? context) {
if (futureElementResolved == null) {
return;
} else if (futureElementResolved is T) {
treeMap.map(domElement, futureElementResolved as T, allowOverwrite: true);
if (parent != null) {
replaceChildElement(
parent, templateElement, [futureElementResolved as T]);
}
} else if (parent != null) {
var children = addExternalElementToElement(parent, futureElementResolved);
if (isEmptyObject(children)) {
removeChildFromElement(parent, templateElement);
} else {
var node = children!.first;
treeMap.map(domElement, node);
for (var child in children) {
removeChildFromElement(parent, child);
}
replaceChildElement(parent, templateElement, children);
}
}
}