I have a very simple and strange problem in an array in which I declare it for example:
$scope.pactUpdates = [];
The problem is when I push on that array and I want to assign the value of a control that is empty.
$scope.pactUpdates.push({'data1':$scope.data1,'data2':$scope.data2, 'data3':$scope.data3});
The problem is that if in the input data1
do not load anything, in the array I put it in the following way:
{'data2':'hola1','data3':'hola2'}
If I do a second push, it does add the array to me, even though it has not loaded any data with data:
{'data1':'','data2':'hola1111','data3':'hola2222'}
What am I doing wrong? I already try to impute to put a ng-init=' '
to at least take something empty.