Angular material 有 angularJS 申请
Angular material with angularJS application
我计划在我的应用程序中实施 angular material 设计。我已经包含了 material.js 和 material.css 并且应用程序定义如下,
这是代码,
Index.html:
<script src="js/ripples.js"></script>
<script src="js/material.js"></script>
app.js
ar routerApp = angular.module('DiginRt', ['ui.bootstrap','SimpleCouch','ngMaterial']);
当我开始运行应用程序时,它说
Uncaught Error: [$injector:modulerr] Failed to instantiate module DiginRt due to:
Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to:
Error: [$injector:nomod] Module 'ngMaterial' 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。没有看到代码示例,我不能比这更具体。正如@rebornix 所说,jsfiddle 或 Plunker 会很有帮助。
我已经使用此顺序注入创建了我的 angular material 设计项目,希望对您有所帮助,
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/hammerjs/hammer.js"></script>
<script src="bower_components/angular-material/angular-material.js"></script>
...
<script src="app.js"></script>
顺便说一句,您是使用 bower install angular-material --save 安装的吗?
我计划在我的应用程序中实施 angular material 设计。我已经包含了 material.js 和 material.css 并且应用程序定义如下, 这是代码,
Index.html:
<script src="js/ripples.js"></script>
<script src="js/material.js"></script>
app.js ar routerApp = angular.module('DiginRt', ['ui.bootstrap','SimpleCouch','ngMaterial']);
当我开始运行应用程序时,它说
Uncaught Error: [$injector:modulerr] Failed to instantiate module DiginRt due to:
Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to:
Error: [$injector:nomod] Module 'ngMaterial' 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。没有看到代码示例,我不能比这更具体。正如@rebornix 所说,jsfiddle 或 Plunker 会很有帮助。
我已经使用此顺序注入创建了我的 angular material 设计项目,希望对您有所帮助,
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/hammerjs/hammer.js"></script>
<script src="bower_components/angular-material/angular-material.js"></script>
...
<script src="app.js"></script>
顺便说一句,您是使用 bower install angular-material --save 安装的吗?