gpt4 book ai didi

javascript - 为 angular-materialize 添加依赖项时出错

转载 作者:行者123 更新时间:2023-11-30 16:08:20 24 4
gpt4 key购买 nike

我想为我的 Angular 项目使用物化 https://github.com/krescruz/angular-materialize但我得到了错误

angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module F1FeederApp due to: Error: [$injector:modulerr] Failed to instantiate module ui.materialize due to: Error: [$injector:nomod] Module 'ui.materialize' 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.

在我的 app.js 中:

angular.module('F1FeederApp', [
'ui.materialize',
'F1FeederApp.services',
'F1FeederApp.controllers',
'ngRoute'
]).

我做错了什么?根据上面的链接,这些声明应该足够了..

最佳答案

如果您使用的是 Bower,请尝试在项目的根目录下运行它。

bower install angular-materialize --save

并将源文件 angular-materialize/src/angular-materialize.js 添加到您的 index.html

如果您不使用 Bower 或节点下载 this将文件添加到您的项目中并将其添加到您的 index.html

希望对你有帮助

关于javascript - 为 angular-materialize 添加依赖项时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36675701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com