Open ghost opened 9 years ago
Hoy,
Thanks for the report. Any chance you could provide an example of how you use ngStorage in your app?
I use it like this in an app that uses AngularJS 1.4.5, ngMaterial 0.10.1 and ngStorage 0.3.9:
app.service('Leads', ['$rootScope', '$log', '$localStorage',
function ($rootScope, $log, $localStorage) {
if (!$localStorage.Leads) {
$localStorage.Leads = [];
}
var leads = $localStorage.Leads;
// ... snip ...
return leads;
}]);
Hey,
My use case:
angular
.module('app')
.controller('BlogImageDialogController', BlogImageDialogController);
BlogImageDialogController.$inject = ['$scope', '$mdDialog', ..... '$localStorage'];
function BlogImageDialogController($scope, $mdDialog, ...... localStorage) {
...
That error was appearing just because of using localStorage as DI (weird). Even after removing all the code from the modal controller I was still getting this error.
( I've found a work-around for my case though: i'm passing vars using locals: {} obj in the mdDialog config, thus avoiding $localStorage in the modal controller at all. )
Hope this helps! D.
Hi.. After a little research i found the cause of the issue. but fixing it is upto dev's.
So you are using this to store files in the local storage. so after selecting a file, the file is injected into the localstorage but in a different way rather than as a file because angular.copy cannot copy files and in line number 178 we have
temp$storage = angular.copy(_last$storage);
This copies the file to the temp$storage incorrectly making the angular.equals throw error on the next digest cycle. So this is an issue with angular.copy not supporting deep copy of files.
Hope this helped.
Hi, any update or workarounds? Can we catch this exception and ignore it?
Hi,
Getting this:
Error message goes away if I disable "_last$storage = angular.copy($storage);" on line 176 of ngStorage.js
Any thoughts are really appreciated!
AngularJS 1.4.5 Material Design, from master ngStorage 0.3.9
Thanks, Dennis