-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainController.js
36 lines (31 loc) · 974 Bytes
/
mainController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var app = angular.module('chartedReadsApp', ['ngRoute']);
// configure our routes
app.config(function($routeProvider, $locationProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl : 'pages/home.html',
controller : 'mainController'
}).when('/signedin', {
templateUrl : 'pages/signedin.html',
controller : 'mainController'
}).when('/app', {
templateUrl : 'pages/app.html',
controller : 'mainController'
}).otherwise({
redirectTo:function () {
var url = (location.href).split('?');
if(url.length===1)
return '/';
else
return '/signedin';
}
});
// use the HTML5 History API
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
});
app.controller('mainController', function($scope){
});