我的应用程序设置$routeProvider
为:
angular.module('myApp', [])
.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/authorisation', { template: 'templates/authorisation.html', controller: AuthenticationController})
.otherwise('templates/404.html');
}]);
我index.html
的是:
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<title>Gift Cloud Dash</title>
<script src="lib\angular\angular.js"></script>
<!-- App config -->
<script src="js\app.js"></script>
<!-- Import controllers -->
<script src="js\controllers\authentication-controller.js"></script>
</head>
<body>
<div>
<a href="#/authorisation">Authorisation</a>
</div>
<div ng-view></div>
</body>
</html>
当我打开索引页面时,我会看到超链接,但是当我单击它时,会显示文件路径,而不是在<div ng-view></div>
.