Ionic permanently removing items from tab list -


having issue clearing out , refreshing list items within tab view.

a) within service, refresh sets return object null (verified) calls fresh data (verified) , returns controller (verified).

b) within controller, before refresh called, validate length of returned object(verified length of 6), set object null (verified null), refresh data , validate returned object (verified length of 6 again).

my expectation original list of 6 items clear out , replaced new list of 6 items. however, html template list of 6 items grows list of 12, duplicating original list. further more, new list of 12 seems sorted duplicates listed in order pairs - seems being sorted. don't understand behavior , can't figure out how displayed list clear out.

.controller:      $scope.dorefresh = function() {       alert(object.keys($scope.prods).length) ;  // (6)       $scope.prods= {} ;       alert(object.keys($scope.prods).length) ;  // (0)       $scope.prods= prods.refresh();       alert(object.keys($scope.prods).length) ;  // (6)     }  .service:    refresh: function() {      prods= [] ;      getprods() ;      return prods;    }, 

i fixed issue. own code. in "getprods()" wasn't setting return object null, every time hit refresh object adding new data onto existing object, , returning controller twice previous size.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -