angularLocalStorage
angularLocalStorage copied to clipboard
bind and $$hashKey
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 - Can you view this file and let me know if it doesn't cover your example.
http://plnkr.co/edit/PNLjDEaRKtpLgGZMJypk?p=preview