angularLocalStorage icon indicating copy to clipboard operation
angularLocalStorage copied to clipboard

bind and $$hashKey

Open YaroslavLyzlov opened this issue 12 years ago • 1 comments

app.controller('CreateCtrl', function ($scope) {
      $scope.create = {a:1, b:2, c:3};
      $scope.send = function () {
         $scope.$emit('send', angular.copy($scope.create));
      }
});
app.controller('ListCtrl', function ($scope, $rootScope) {
      $scope.list = [];
      $rootScope.$on('send', function (e, data) {
         $scope.list.push(data);
      });
}) ;

last element in $scope.list on LocalStorage does not have a $$hashKey if $scope.list bind to Storage. because of this error happens ng repeat dupes (duplicate)

YaroslavLyzlov avatar Oct 23 '13 08:10 YaroslavLyzlov

@YaroslavLyzlov - Can you view this file and let me know if it doesn't cover your example.

http://plnkr.co/edit/PNLjDEaRKtpLgGZMJypk?p=preview

hppycoder avatar Jan 30 '15 15:01 hppycoder