How to show object values in HTML persistently
<p>Let's suppose I am having an object like <code>y={1,2,3}</code>. I want to display its value using Angular in HTML.</p>

<p>So what I did is:</p>

<pre><code>for(var i=0;i&lt;y.length;i++){
      $scope.data=y[i]; //transferring
}
</code></pre>

<p>and in my HTML it is written:</p>

<pre><code>   &lt;html&gt;
      {{data}}
   &lt;/html&gt;
</code></pre>

<p>Now I know that it is showing the last value(3) because the data value is updated at the end, and since the last value of the loop is 3 it sets the 3 in HTML. So my question is how can we fix this problem?</p>