-
Notifications
You must be signed in to change notification settings - Fork 95
/
app.js
36 lines (31 loc) · 1.26 KB
/
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
30
31
32
33
34
35
36
'use strict';
/* App Module */
var petClinicApp = angular.module('petClinicApp', [
'ui.router', 'infrastructure', 'layoutNav', 'layoutFooter', 'layoutWelcome',
'ownerList', 'ownerDetails', 'ownerForm', 'petForm', 'visits', 'vetList']);
petClinicApp.config(['$stateProvider', '$urlRouterProvider', '$locationProvider', '$httpProvider', function(
$stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) {
// safari turns to be lazy sending the Cache-Control header
$httpProvider.defaults.headers.common["Cache-Control"] = 'no-cache';
$httpProvider.interceptors.push('HttpErrorHandlingInterceptor');
$locationProvider.hashPrefix('!');
$urlRouterProvider.otherwise('/welcome');
$stateProvider
.state('app', {
abstract: true,
url: '',
template: '<ui-view></ui-view>'
})
.state('welcome', {
parent: 'app',
url: '/welcome',
template: '<layout-welcome></layout-welcome>'
});
}]);
['welcome', 'nav', 'footer'].forEach(function(c) {
var mod = 'layout' + c.toUpperCase().substring(0, 1) + c.substring(1);
angular.module(mod, []);
angular.module(mod).component(mod, {
templateUrl: "scripts/fragments/" + c + ".html"
});
});