注入ngRoute时的Angular $ injector modulerr错误

时间:2017-04-01 13:14:20

标签: javascript angularjs angular-routing angularjs-ng-route

当我包含ngRoute进行路由时,我收到此错误$ injector MOdulerr,请告诉我我做错了什么。任何帮助将不胜感激。 下面是我的两个文件,index.html和app.js

<head>   
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-route.min.js"></script>
 <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-aria.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-messages.min.js"></script>
 <script type="text/javascript" src='app.js'></script>
 <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.1/angular-material.min.js"></script> 
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css"> 
</head>

app.js

var myapp = angular.module('myapp',['ngRoute'])
myapp.config(function($routeProvider,$locationProvider){
    $locationProvider.hashPrefix('');
    $routeProvider
        .when('/sign-in', {
            templateUrl: 'templates/sign-in.html',
            controller: 'appctrl'

    })
})

myapp.controller('appctrl', function ($scope) {

});

0 个答案:

没有答案