angularjslocal-storageng-storage

Default configuration for ngStorage


I would like to use $localStorage for ngStorage through out my application. Is there any way to configure it in app.config so that I don't need to repeat $scope.$storage = $localStorage; code in every controller/service where I needed.

Thanks in advance.


Solution

  • You can use .run on your module and set $localstorage.$default there so it will be initialized when your app runs.