forked from marcorinck/ngStart
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
40 lines (29 loc) · 1.14 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
37
38
39
40
define(['angular', 'config/config', 'angular-route', 'about/about', 'contact/contact', 'navbar/navbar'], function (angular, config) {
"use strict";
var app = angular.module("app", config.standardAngularModules);
app.config(['$httpProvider', '$routeProvider', '$translateProvider', function ($httpProvider, $routeProvider, $translateProvider) {
var httpLogInterceptor;
$translateProvider.useStaticFilesLoader({
prefix: 'modules/translations/locale-',
suffix: '.json'
});
$translateProvider.preferredLanguage('en');
$translateProvider.useMissingTranslationHandlerLog();
$routeProvider.otherwise({redirectTo: '/about/'});
httpLogInterceptor = ['$q', function ($q) {
function success(response) {
console.log("Successful HTTP request. Response:", response);
return response;
}
function error(response) {
console.log("Error in HTTP request. Response:", response);
return $q.reject(response);
}
return function (promise) {
return promise.then(success, error);
};
}];
$httpProvider.responseInterceptors.push(httpLogInterceptor);
}]);
return app;
});