Javascript 未能实例化模块formlyBootstrap

Javascript 未能实例化模块formlyBootstrap,javascript,angularjs,twitter-bootstrap,angular-formly,Javascript,Angularjs,Twitter Bootstrap,Angular Formly,我已经通过bower在一个我一直从事的项目上安装了angular formly templates bootstrap。但当我尝试将其注入angular时,我收到以下错误: Uncaught Error: [$injector:modulerr] Failed to instantiate module bandar due to: Error: [$injector:modulerr] Failed to instantiate module formlyBootstrap due to: E

我已经通过bower在一个我一直从事的项目上安装了
angular formly templates bootstrap
。但当我尝试将其注入angular时,我收到以下错误:

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模板引导程序。还有一些其他软件包正在通过bower加载到浏览器中。但是我不知道formlyBootstrap的问题是什么,因为它遇到了同样的错误。我使用的是gulp角度发生器,它似乎忽略了形式上的引导。我将bower_组件中angular formly引导模板的主文件更改为dist/…bootstrap.min.js。从那以后开始工作。生成器似乎忽略了末尾有bootstrap.js的文件

是否使用gulp作为InjectBower依赖项?如果是这样的话,可以在gulp配置中找到类似的内容

exports.wiredep = {
  exclude: [/bootstrap.js$/, /bootstrap-sass-official\/.*\.js/, /bootstrap\.css/],
  directory: 'bower_components'
};
exports.wiredep = {
  exclude: [/[^-]bootstrap.js$/, /bootstrap-sass-official\/.*\.js/, /bootstrap\.css/],
  directory: 'bower_components'
};
因此,所有文件都以“bootstrap.js”结尾,但没有注入。你可以用那样的东西来改变它

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

Angular找不到该模块,因此看起来您要么没有定义它,要么没有正确定义它,要么没有在HTML页面中加载它。我添加了一些额外的解释。我希望它能帮助@Mattherbstritt如果不重新配置这些模板,它们将无法与bower一起正常工作yourself@charlietfl在它的文档中,我找不到关于重新配置它的东西。是否有任何文件显示了正确的操作方法?!您确定页面上包含了
angular formly templates引导脚本吗?这是所有人都在做的事情。另外,确保在自定义脚本之前包含它。希望我能给你更多我的观点。这个解决方案为我节省了很多时间。