baseInnerHtml property
Implementation
@nonVirtual
String get baseInnerHtml {
var wrapper = HTMLTemplateElement();
wrapper.appendChild(_baseInnerElement!);
return wrapper.getHTML();
}
Sanitizes and sets the baseInnerHtml
of this component.
Will throw ComponentNoIdException if there is no id=""
attribute
with the same id value found inside the baseInnerHtml
string. This
ensures that the DOM is in sync with the object (meaning that the
component with id test will really be rendered into DOM with id="test"
in the tag.
Setting this with new value also changes baseInnerElement attribute.
It does not change the rendered looks. In other words, if this component
has been rendered, changing baseInnerHtml
won't change a thing in the
browser. You need to re-render it again. This behavior will probably
change in the future.
Implementation
@protected
set baseInnerHtml(String baseInnerHtml) {
var template = document.createElement('template') as HTMLTemplateElement;
template.innerHTML = baseInnerHtml.trim().toJS;
_baseInnerElement = template.content.children.item(0);
if (_baseInnerElement!.id != id) {
throw ComponentNoIdException(id);
}
}