Matteo Scandolo | 817386b | 2015-11-04 16:07:09 +0100 | [diff] [blame] | 1 | (function() { |
| 2 | 'use strict'; |
| 3 | |
Matteo Scandolo | ba4c9aa | 2016-02-11 09:35:29 -0800 | [diff] [blame] | 4 | angular.module('bugSnag', []).factory('$exceptionHandler', function () { |
| 5 | return function (exception, cause) { |
| 6 | Bugsnag.notifyException(exception, {diagnostics:{cause: cause}}); |
| 7 | }; |
| 8 | }); |
| 9 | |
Matteo Scandolo | 817386b | 2015-11-04 16:07:09 +0100 | [diff] [blame] | 10 | angular |
| 11 | .module('xos.helpers',[ |
Matteo Scandolo | 3c217ad | 2015-11-05 16:02:11 +0100 | [diff] [blame] | 12 | 'ngCookies', |
| 13 | 'xos.xos', |
| 14 | 'xos.hpcapi', |
Matteo Scandolo | ba4c9aa | 2016-02-11 09:35:29 -0800 | [diff] [blame] | 15 | 'xos.xoslib', |
| 16 | 'bugSnag' |
Matteo Scandolo | 817386b | 2015-11-04 16:07:09 +0100 | [diff] [blame] | 17 | ]) |
| 18 | .config(config); |
| 19 | |
| 20 | function config($httpProvider, $interpolateProvider, $resourceProvider) { |
| 21 | $httpProvider.interceptors.push('SetCSRFToken'); |
| 22 | |
| 23 | $interpolateProvider.startSymbol('{$'); |
| 24 | $interpolateProvider.endSymbol('$}'); |
| 25 | |
| 26 | // NOTE http://www.masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html |
| 27 | $resourceProvider.defaults.stripTrailingSlashes = false; |
| 28 | } |
| 29 | })(); |