Answer the question
In order to leave comments, you need to log in
How to write a loop for an array, for Angular?
Hello, how to write, or is it possible to write a loop that would create elements for an array. To bring it to Angular via ng-Reapeat.
For example, you need to create an array:
$scope.phones = [
{'name' : 'Nexus',
'snippet' : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
'status': true},
{'name' : 'HTC',
'snippet' : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
'status' : false},
{'name' : 'Huawei',
'snippet' : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.',
'status' : true}
];
Answer the question
In order to leave comments, you need to log in
To bring it to Angular via ng-Reapeat.
I think it's better to learn js first (for example , learn.javascript.ru here ), and only then start learning angular.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question