angularjs的一点总结
一,错误小结
1.出现类似于下面的错误,就是说明 $sessionStorage 这个服务未找到
Error: [$injector:unpr] Unknown provider: $sessionStorageProvider <- $sessionStorage <- LoginCtrl
解决办法是引入这个服务(ngStorage中包含sesseionStorage和localStorage等):
var userModule=angular.module('userModule', [ 'ngStorage']);
2.出现如下错误,是说明ngStorage这个服务为安装:
Uncaught Error: [$injector:modulerr] Failed to instantiate module userModule due to:
Error: [$injector:modulerr] Failed to instantiate module ngStorage due to:
Error: [$injector:nomod] 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.
解决办法是安装这个服务:
bower install ngstorage