0

在我的项目中,我遇到了关于 angular-cookies 包的问题。

我已经下载了这个包并将它放在我的项目中。和通常一样,在 index.html 中,我添加了一个脚本标签:

<script src="vendor/angular-cookies/angular-cookies.min.js" charset="UTF-8"></script>

但是当页面加载时,我收到一条错误消息:

Uncaught TypeError: c.module(...).info is not a function at angular-cookies.min.js:7

在包中,它使用angular.module.info但它不被视为一个功能?

那么这个问题的原因是什么?是因为版本问题吗?任何帮助

4

2 回答 2

0

您应该根据角度安装特定的依赖项。您可以通过使用 bower install 来实现它,如下所示:

bower install angular-cookies@1.5.8

bower install angular@1.5.7
于 2017-07-28T10:04:41.270 回答
0

我最近完成的凉亭更新遇到了同样的问题。我不知道角度 1.6.3 是否稳定,所以我去了https://code.angularjs.org/latest/,我看到使用的是 1.5.8 角度版本。

因此,为了解决它,我在 bower.json 中添加了这些版本:

“依赖”:{
“角饼干”:“1.5.8”,
},

“决议”:{
“角度”:“1.5.8”
}

于 2017-03-13T09:57:04.687 回答