blob: fb58015b33eeafe7e9e3c444289e5528d9030de5 [file] [log] [blame]
Matteo Scandolo817386b2015-11-04 16:07:09 +01001(function() {
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -07002 'use strict';
Matteo Scandolob585d382016-06-15 14:53:33 -07003
Matteo Scandolo57404dc2016-04-13 16:20:13 -07004 /**
5 * @ngdoc overview
6 * @name xos.helpers
7 * @description this is the module that group all the helpers service and components for XOS
8 **/
9
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -070010 angular
11 .module('xos.helpers', [
12 'ngCookies',
13 'ngResource',
Matteo Scandolob0280752016-04-25 10:31:22 -070014 'ngAnimate',
Matteo Scandolob9fb6252016-05-26 15:09:55 -070015 'xos.uiComponents'
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -070016 ])
Matteo Scandolo7bc39c42016-04-20 11:38:42 -070017 .config(config)
Matteo Scandolo974c0e42016-05-25 16:02:16 -070018
19 /**
20 * @ngdoc service
21 * @name xos.helpers._
22 * @description Wrap [lodash](https://lodash.com/docs) in an Angular Service
23 **/
24
Matteo Scandolo7bc39c42016-04-20 11:38:42 -070025 .factory('_', $window => $window._ );
Matteo Scandolo817386b2015-11-04 16:07:09 +010026
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -070027 function config($httpProvider, $interpolateProvider, $resourceProvider) {
28 $httpProvider.interceptors.push('SetCSRFToken');
Matteo Scandolo817386b2015-11-04 16:07:09 +010029
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -070030 $interpolateProvider.startSymbol('{$');
31 $interpolateProvider.endSymbol('$}');
Matteo Scandolo817386b2015-11-04 16:07:09 +010032
Matteo Scandolobd2e5cd2016-04-12 11:59:29 -070033 // NOTE http://www.masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html
34 $resourceProvider.defaults.stripTrailingSlashes = false;
35 }
Matteo Scandolo817386b2015-11-04 16:07:09 +010036})();