我在添加&n; ngMaterial'时遇到错误因某种原因依赖!我将显示我的文件,然后错误。
的index.html:
<!DOCTYPE html>
<html>
<head>
<meta id="meta" name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link href='https://fonts.googleapis.com/css?family=RobotoDraft:400,500,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/dist/css/vendor.min.css" type="text/css" />
<script type="text/javascript" src="assets/dist/js/vendor.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.0.9/angular-material.min.js"></script>
<link rel="stylesheet" href="global.css" type="text/css" />
<link href="https://code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="https://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.0.9/angular-material.min.css" />
<script type="text/javascript" src="app/app.module.js"></script>
<script type="text/javascript" src="app/app.route.js"></script>
<script type="text/javascript" src="assets/dist/js/app.min.js"></script>
</head>
<body ng-app="Hive">
<!--<ion-side-menus enable-menu-with-back-views="false">-->
<!-- Main View -->
<div ui-view class="main_view">
</div>
<ion-tabs class="tabs-icon-top tabs-energized">
<ion-tab title="Home" icon="ion-home" ui-sref="home">
<ion-nav-view name="home-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="Discussions" icon="ion-android-contacts" ui-sref="discussions">
<ion-nav-view name="discussions-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="Board" icon="ion-ios-list-outline" ui-sref="board">
<ion-nav-view name="list-tab"></ion-nav-view>
</ion-tab>
<ion-tab title="Me" icon="ion-android-happy" ui-sref="me">
<ion-nav-view name="profile-tab"></ion-nav-view>
</ion-tab>
</ion-tabs>
</body>
</html>
app.module.js:
(function (angular) {
'use strict';
angular.module('Hive', [
//Deps
'ionic',
'firebase',
'ngMaterial'
]
);
});
错误:
vendor.min.js:3 Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.2.7/$injector/nomod?p0=Hive
vendor.min.js:3 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.7/$injector/modulerr?p0=Hive&p1=Error%3A%20…users.io%2Famanuel2%2Fhive%2Fassets%2Fdist%2Fjs%2Fvendor.min.js%3A3%3A9097)
帮助将不胜感激! :)
答案 0 :(得分:-1)
您缺少angularjs的引用,如下所示加载
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<!-- Angular Material Javascript now available via Google CDN; version 0.8 used here -->
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.3/angular-material.min.js"></script>