How to show object values in html persistently. : Let suppose I am having an object like y={1,2,3}.I want to display its value using angular in html.
    So what I did is:
    for(var i=0;i<y.length;i++){
          $scope.data=y[i]; //transferring
    }
    and in my html it is written:
    <html>
          {{data}}
    </html>
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?