Skip to content
This repository was archived by the owner on Jan 30, 2021. It is now read-only.

.append

Alper Kürşat edited this page May 24, 2018 · 1 revision

.append( elements Array, reverse Boolean )

Appends element/s to an Element

.append doesn't create reliable(.parent/.View) connection between parent and children. To make connected append, use .has .has method

let Elem='Parent'.append([
    'Child'.init(),
    'Child2'.init()
]);
O.ready.then(b=>b.append(Elem));     //Append Elem to document.body
<div class="Parent">
    <div class="Child"></div>
    <div class="Child2"></div>
</div>

Reverse append

To append elements reverse ordered, set reverse true

let Elem='Parent'.append([
    'Child'.init(),
    'Child2'.init()
],true);
O.ready.then(b=>b.append(Elem));     //Append Elem to document.body
<div class="Parent">
    <div class="Child2"></div>
    <div class="Child"></div>
</div>

Clone this wiki locally