I'm having a problem where I need to build a content type. First, I define my model. I'm using Drupal so I need to send values nested in things like:
field_whatever.und[0].value = "";
Say I define an array for images:
$scope.field_my_images = {"und": [{}]};
Because I have a blank array:
<div ngRepeat="image in field_my_images.und"><img ng-src="{{image.url}}" /></div>
Will print the first array element blank. As I push new objects to field_my_images, it works correctly except for the first blank element.
What's the proper way to do this?
I can add details and be more specific as needed....
shouldn't you initialize your scope with this instead?
$scope.field_my_images = {"und": []};
Otherwise, you don't have an empty array, you have an array with an empty object.