How to access ng-init variables using div DOM element?
<p>in the below code, variables are defined using <code>ng-init</code> directive, angular expression gives the access to those variables,</p>

<pre><code>    &lt;body ng-app=""&gt;
        &lt;div ng-init="arr = [1, 2, 3, 4];obj={x:1}"&gt;
            {{arr[0]}}
        &lt;/div&gt;
    &lt;/body&gt;
</code></pre>

<hr>

<p>Using javascript code, </p>

<pre><code>    &lt;body ng-app=""&gt;
        &lt;div ng-init="arr = [1, 2, 3, 4];obj={x:1}"&gt;
            &lt;script  type="text/javascript"&gt;
             //access arr[0] using div DOM object
            &lt;/script&gt;
        &lt;/div&gt;
    &lt;/body&gt;
</code></pre>

<hr>

<p>I learnt that the data is directly binded to view(DOM).</p>

<p>To know the under-hood working of <code>ng-init</code> directive, How do I access <code>arr[0]</code> using <code>div</code> DOM element?</p>