Update an Angular variable in the view
问题 I would like my output to read 0 01 012 0123 01234 etc... I expected this simple code I wrote to do the trick, but instead it prints 01111111111 011111111111 02222222222 022222222222 03333333333 033333333333 04444444444 044444444444 05555555555 055555555555 06666666666 066666666666 Why is this happening? This is my Angular code: <div ng-app="App" ng-controller="ctrl"> <div ng-repeat="num in [1, 2, 3, 4, 5, 6]"> <label>{{previousNumber}}</label> {{previousNumber = (previousNumber + "" + num)}}