I recently switched to Angular 4 from Angular 1, and now there is a lot for me. One of them seems to be related to data binding. In the old version, I declared the array as $ scope.arrname in the JS controller, and I could navigate through it as HTML using ng-repeat.
Now, when I try to achieve the same result, it only works partially. What am I doing wrong?
Example: in the component, I declared a test array testarr: any [] = [1,2,3];
{{testarr}}
> Prints 1,2,3 on the scrreen
<ol>
<li ng-repeat="item in testarr">{{item}}ITEM Found!</li>
</ol>
>only iterates 1 time (ignoring the 2,3) in the array.
Run codeHide resultWhy does my code not iterate over the array, as it was before? What am I missing here?
source
share