当我尝试从localhost8000加载我的index.html页面时出现以下错误。未捕获的错误角度未在main.js页面的第2行上定义。未定义未捕获的错误角度未定义
的Index.html:
<!DOCTYPE html>
<html lang='en' ng-app='App'>
<head>
<meta charset="utf-8">
<script src = 'angular/angular.js'></script>
<script src = 'angular-route/angular-route.js'></script>
<script src = 'js/main.js'></script>
<title></title>
</head>
<body>
<ng-view></ng-view> <!-- Allows loading of partials-->
</body>
</html>
Main.js page:
// Will handle our ng-routes
var app = angular.module('App', ['ngRoute'])
// Configure the partials
app.config(function($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/partials/_ninjas.html', // Allows us to move around and see all the ninjas
});
});
是否有错字的地方在我的代码,我没有看到。我仍然参加在线编码训练营学习编码,所以任何提示将不胜感激:)
那这样做做的伎俩感谢帮助:) –
@DanielMayle你可以标记接受的答案,如果它帮助。 – abdoutelb
确定点击绿色复选标记吧? –