DomStrategy
DomStrategy
is a class exposed by @abp/ng.core package. Its instances define how an element will be attached to the DOM and are consumed by other classes such as LoadingStrategy
.
API
constructor
target
is an HTMLElement (default: document.head).position
defines where the created element will be placed. All possible values ofposition
can be found here (default: 'beforeend').
insertElement
This method inserts given element
to target
based on the position
.
Predefined Dom Strategies
Predefined dom strategies are accessible via DOM_STRATEGY
constant.
AppendToBody
insertElement
will place the given element
at the end of <body>
.
AppendToHead
insertElement
will place the given element
at the end of <head>
.
PrependToHead
insertElement
will place the given element
at the beginning of <head>
.
AfterElement
insertElement
will place the given element
after (as a sibling to) the target
.
BeforeElement
insertElement
will place the given element
before (as a sibling to) the target
.