I have trouble to set dynamic array key.
Here is my code,
HTML
<div ng-controller="myCtrl">
<form ng-submit="sendPost()">
<input ng-model="newName[12]"/>
<button type="submit">Send</button>
</form>
</div>
Controller
angular.module('myApp', [])
.controller('myCtrl', function ($scope, $http) {
$scope.hello = {name: "Boaz"};
$scope.newName = [];
$scope.sendPost = function() {
console.log($scope.newName);
}
})
Expected Output
[12] => 13 (Input value)
[15] => 14 (Input value)
Que By setting dynamic input array key i can get empty key values.
Also you can check fiddle.
In this fiddle you can get empty object keys in console.
Thank you !

ng-model="newName[12]"?