Skip to main content

Keeping two arrays one for delete and one for insertion seems a good idea to me and these arrays can be easily maintained with $watch where you can check old and new value. For example:-

var scope = $rootScope;
scope.$watch('petsArray', function(newValue, oldValue) {
   if ( newValue !== oldValue ) {
      //Do your changes
    }
});

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } }); SendingSending requests on every insert and delete will increase the number of hits on the server.

Keeping two arrays one for delete and one for insertion seems a good idea to me and these arrays can be easily maintained with $watch where you can check old and new value. For example:-

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } }); Sending requests on every insert and delete will increase the number of hits on the server.

Keeping two arrays one for delete and one for insertion seems a good idea to me and these arrays can be easily maintained with $watch where you can check old and new value. For example:-

var scope = $rootScope;
scope.$watch('petsArray', function(newValue, oldValue) {
   if ( newValue !== oldValue ) {
      //Do your changes
    }
});

Sending requests on every insert and delete will increase the number of hits on the server.

added 177 characters in body
Source Link

ThisKeeping two arrays one for delete and one for insertion seems a good idea to me and these arrays can be achieved by usingeasily maintained with $watch in angularJs where you can check old and new value. For example:-

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } }); Sending requests on every insert and delete will increase the number of hits on the server.

This can be achieved by using $watch in angularJs where you can check old and new value. For example:-

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } });

Keeping two arrays one for delete and one for insertion seems a good idea to me and these arrays can be easily maintained with $watch where you can check old and new value. For example:-

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } }); Sending requests on every insert and delete will increase the number of hits on the server.

Source Link

This can be achieved by using $watch in angularJs where you can check old and new value. For example:-

var scope = $rootScope; scope.$watch('petsArray', function(newValue, oldValue) { if ( newValue !== oldValue ) { //Do your changes } });