Hello everyone and thanks for the help and for reading my Post. I have a Service:
var itemsMarker = {};
itemsMarker.items = [];
so every time I should update the items of itemsMarkers:
//here I should clean the itemsMarker.items
before and
angular.copy(source, itemsMarker.items);
with that Line of code every time the reference of the variable is not lost, so my directive
ng-repeat=itemsMarker.items
updates every time the array changes.
But now I do not want to use angular.copy
because it is slow.
So I tried to replace it these options:
1.- First Option:
itemsMarker.items.length = 0;
itemsMarker.items = _.clone(newArraySameStruct);
Reference is gone. the ng-repeat does not update after the change.
2.- Second option I tried:
itemsMarker.items.length = 0;
itemsMarker.items.push(newArraySameStruct);
but it adds the array newArraySameStruct into
itemMarker.items[0][newArraySameStruct]
How can I implement here? Regards.