【发布时间】:2015-07-14 12:18:13
【问题描述】:
我已经通过 bower 在我一直从事的项目中安装了 angular-formly-templates-bootstrap。但是当我尝试以角度注入它时,我收到以下错误:
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有什么问题。
【问题讨论】:
-
Angular 找不到该模块,所以看起来你要么没有定义它,要么没有正确定义它,要么你没有在 HTML 页面中加载它。
-
我添加了一些额外的解释。我希望它有所帮助......@MattHerbstritt
-
如果不自己重新配置,这些模板无法与 bower 一起正常工作
-
@charlietfl 我在其文档中找不到有关重新配置它的信息。有没有说明正确方法的文件?!
-
您确定已在页面中包含
angular-formly-templates-bootstrap脚本吗?这就是所有the examples 正在做的事情。另外,请确保将其包含在自定义脚本之前。
标签: javascript angularjs twitter-bootstrap angular-formly