-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
29 lines (23 loc) · 781 Bytes
/
app.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
var $routeProviderReference;
var app = angular.module('cdg', [require('angular-route'),'angularUtils.directives.dirPagination']);
var basel = require('basel-cli');
var routes = basel.routes();
app.config(['$routeProvider', function($routeProvider) {
$routeProviderReference = $routeProvider;
}]);
app.run(['$rootScope', '$http', '$route', function($rootScope, $http, $route) {
//getting routes
angular.forEach(routes, function (route) {
$routeProviderReference.when( route.when, route.data );
});
/**
* For new routes:
* $routeProviderReference.when('/when',{
* controller: 'yourController',
* templateUrl: 'your-view.html'
* })
*
*/
$routeProviderReference.otherwise({ redirectTo: '/' });
$route.reload();
}]);