ngStorage in angularjs issue

久未见 提交于 2019-12-14 04:08:54

问题


I want to use ngstorage in my project. so i install this package :

Install-Package gsklee.ngStorage

and it install successfully.then in my app i insert dependency:

  var app = angular.module("app", ['ngRoute', 'ui.bootstrap', 'ngAnimate', 'ngStorage'])
    .config(['$httpProvider', '$controllerProvider', '$routeProvider', function ($httpProvider, $controllerProvider, $routeProvider) {
        app.cp = $controllerProvider;
        $httpProvider.defaults.withCredentials = true;
    }]);

and in the page i use it like this:

<script>
  app.cp.register('userProfileController', function ($window, $localStorage) {
    function reload() {
        $localStorage.hasReloaded = true;
        $window.location.reload();
    }
    debugger;
    if (!$localStorage.hasReloaded) {
        reload();
    }
});

</script>

but it doesn't work. and it gives me this error:

Module 'ngstorage' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

what is the problem?

来源:https://stackoverflow.com/questions/38554425/ngstorage-in-angularjs-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!