Is it possible to create an array using ng-init
dynamically?
The bellow code is not working
ng-init="medi_count = new Array(5)"
Is it possible to create an array using
|
|||
Angular expression is not same like JavaScript expression. It has some limits.!
Refer Angular Documentation : Angular Expression |
|||
|
Sure you can its just the same way you create Arrays..
|
||||
|
ng-init is for loading data into an array, as other answer shows. If you just want a new empty array, then make it in the controller
|
|||
|
You can do it pretty fine by calling a function
where
as answered in this question |
|||
|
ng-init
for such initialization..keep this is controller would make more sense.. – Pankaj Parkar Jan 28 at 12:20