【发布时间】:2017-09-26 23:05:39
【问题描述】:
我正在使用 AngularJS v1.6.0。
我的代码:
var app= angular.module("appp",["ngMaterial"]);
错误:Module 'ngMaterial' is not available! You either misspelled the module name or forgot to load it.
这个 SO solution 说包括 ngAria 和 ngAnimate,我这样做了:
var app= angular.module("charter",["ng","ngAnimate","ngAria","ngMaterial"]);
现在我收到此错误:
Module 'ngAnimate' is not available! You either misspelled the module name or forgot to load it.
在我的 HTML 中,<head> 是 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.js"></script>。
我需要更多的依赖吗?
【问题讨论】:
-
当您没有在 HTML 中包含脚本时,通常会出现此错误。如果您在 angular 本身之前放入脚本 angular 材料,有时会发生这种情况。
-
在我的 HTML 中
<head>是<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.js"></script> -
在问题中粘贴你的 html ;)
-
是的,您还需要包含角度材料依赖项!检查此代码笔:codepen.io/team/AngularMaterial/pen/RrbXyW
标签: angularjs