gpt4 book ai didi

javascript - 无法实例化模块 formlyBootstrap

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:02:21 24 4
gpt4 key购买 nike

我已经通过 bower 在我一直从事的项目中安装了 angular-formly-templates-bootstrap。但是当我尝试以 Angular 注入(inject)它时,我收到以下错误:

Uncaught Error: [$injector:modulerr] Failed to instantiate module bandar due to:
Error: [$injector:modulerr] Failed to instantiate module formlyBootstrap due to:
Error: [$injector:nomod] Module 'formlyBootstrap' 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.
http://errors.angularjs.org/1.4.1/$injector/nomod?p0=formlyBootstrap
at http://localhost:3000/bower_components/angular/angular.js:68:12
at http://localhost:3000/bower_components/angular/angular.js:1949:17
at ensure (http://localhost:3000/bower_components/angular/angular.js:1873:38)
at module (http://localhost:3000/bower_components/angular/angular.js:1947:14)
at http://localhost:3000/bower_components/angular/angular.js:4355:22
at forEach (http://localhost:3000/bower_components/angular/angular.js:336:20)
at loadModules (http://localhost:3000/bower_components/angular/angular.js:4339:5)
at http://localhost:3000/bower_components/angular/angular.js:4356:40
at forEach (http://localhost:3000/bower_components/angular/angular.js:336:20)
at loadModules (http://localhost:3000/bower_components/angular/angular.js:4339:5)

问题是,Bower 不会在浏览器中加载 angular-formly-templates-bootstrap。还有一些其他包正在使用 bower 加载到浏览器。但是我不知道 formlyBootstrap 有什么问题。

最佳答案

您是否使用 gulp 注入(inject) Bower 依赖项?如果是这样,在 gulp 配置中找到类似的东西

exports.wiredep = {
exclude: [/bootstrap.js$/, /bootstrap-sass-official\/.*\.js/, /bootstrap\.css/],
directory: 'bower_components'
};

所以所有以“bootstrap.js”结尾的文件都没有被注入(inject)。你可以用类似的东西改变它

exports.wiredep = {
exclude: [/[^-]bootstrap.js$/, /bootstrap-sass-official\/.*\.js/, /bootstrap\.css/],
directory: 'bower_components'
};

关于javascript - 无法实例化模块 formlyBootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31406378/

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