ngRoute不可用

时间:2015-01-23 16:12:44

标签: angularjs ngroute angularjs-ng-route

我在添加angular-route.js时收到ngRoute错误,但我无法理解为什么会发生这种情况

<!DOCTYPE html>
<html ng-app="Userapp">
<head>
<title>Alltotal</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/lib/angular.js"></script>
<scipt src="js/lib/angular-route.js"></scipt>
<script src="js/app.js"></script>
<script src="js/controller/register.js"></script>
<script src="js/controller/show.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<!--navigation-->
<div class="col-lg-12">
<ul class="nav nav-tabs">
<li role="presentation" class="active"><a href="#">Register</a></li>
<li role="presentation"><a href="#">Show users</a></li>
</ul>
</div>
</div>
<!--view-->
<div class="row">
<div class="col-lg-12">
<div ng-view></div>
</div>
</div>
</div>
</body>
</html> 

我的javascipt是​​我认为它完全正确但在运行时不起作用

var app = angular.module("Userapp", ['ngRoute']);

app.config(function ($routeProvider) {
$routeProvider.when('/', {templateUrl : 'partials/form.html',
controller: 'formctrl'});
});

1 个答案:

答案 0 :(得分:0)

这是一个错字!必须是脚本:

<scipt src="js/lib/angular-route.js"></scipt>