gpt4 book ai didi

javascript - Uncaught Error : [$injector:modulerr] when loading Angular Materials

转载 作者:太空宇宙 更新时间:2023-11-04 15:34:25 25 4
gpt4 key购买 nike

我在这里做错了什么?

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular-ui-router/1.0.0-rc.1/angular-ui-router.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-sanitize/1.6.4/angular-sanitize.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.4/angular-material.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="components/app/app.js"></script>
<link rel="stylesheet" href="css/app.css">
</head>
<body data-ng-app="myApp">
<div class="overview">
<md-button>Button</md-button>
</div>

<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p>
<![endif]-->

</body>

应用程序:

var app = angular.module('myApp', ['ui.router', 'ngSanitize', 'ngMaterial']);

我知道这可能是一些愚蠢的小事,但我不知道为什么我不断收到此错误:

angular.js:38 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.6.4/$injector/modulerr?p0=myAp‌​p&p1=Erro…ogleapis.c‌​om%2Fajax%2Flibs%2Fa‌​ngularjs%2F1.6.4%2Fa‌​ngular.min.js%3A22%3‌​A179) at angular.js:38 at angular.js:4920 at q (angular.js:403) at g (angular.js:4880) at eb (angular.js:4802) at c (angular.js:1914) at Sc (angular.js:1935) at ue (angular.js:1820) at angular.js:33367 at HTMLDocument.b (angular.js:3431)

最佳答案

Angular Material 需要一些其他 Angular 模块才能发挥作用。将这些脚本标签添加到您的标题中,您应该可以开始了:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-messages.min.js"></script>

注意:您可能不需要 angular.messages。我不确定那个。

关于javascript - Uncaught Error : [$injector:modulerr] when loading Angular Materials,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44520972/

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