首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AngularJS LocalStorageModule不可用

AngularJS LocalStorageModule不可用
EN

Stack Overflow用户
提问于 2014-09-11 21:17:09
回答 2查看 3.4K关注 0票数 0

我正试图得到一个全新的Ionic项目,在没有运气的情况下,使用棱角的本地存储。我指的是角局部存储错误,但我不知道怎么回事。

https://github.com/grevory/angular-local-storage

代码语言:javascript
复制
ionic start myApp tabs
cd myApp
ionic platform add ios
ionic build ios
bower install angular-local-storage

// app.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'LocalStorageModule'])

然后

代码语言:javascript
复制
ionic serve

错误

代码语言:javascript
复制
Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module LocalStorageModule due to:
Error: [$injector:nomod] Module 'LocalStorageModule' 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.

我错过了什么简单的东西?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-09-11 21:33:33

我不熟悉离子,但在我看来,你好像错过了剧本。

您确定页面中包含了脚本吗?我确认bower确实在您认为脚本应该在的地方安装了脚本,然后在抛出此错误之前确保它的实际引用。

票数 2
EN

Stack Overflow用户

发布于 2016-10-14 10:52:52

盖伊应该检查你有没有给它的脚本添加链接

代码语言:javascript
复制
src="https://rawgit.com/grevory/angular-local-storage/master/dist/angular-local-storage.min.js" 

在索引文件中使用<script></script>标记。这可能是问题所在。对那些将来会看到这一切的人来说。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25797092

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档