Enable HTML5 routing

This commit is contained in:
Thomas Wade 2018-10-17 10:51:47 +10:30
parent bee021d7fd
commit 2a79ae01d7
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@
<script src="scripts/angular.min.js" type="application/javascript"></script>
<script src="scripts/angular-route.min.js" type="application/javascript"></script>
<script src="scripts/app.js" type="application/javascript"></script>
<base href="/" />
</head>
<body>
<div class="rootContainer">

View File

@ -1,13 +1,14 @@
var app = angular.module("app", ["ngRoute"]);
app.config(
function ($routeProvider)
function ($routeProvider, $locationProvider)
{
$routeProvider
.when("/", {templateUrl: "views/news.html", controller: "news"})
.when("/content", {templateUrl: "views/content.html", controller: "content"})
.when("/about", {templateUrl: "views/about.html", controller: "about"})
.when("/login", {templateUrl: "views/login.html", controller: "login"});
$locationProvider.html5mode(true);
}
);