| angular.module('xos.truckroll', [ |
| .config(($stateProvider) => { |
| template: '<truckroll></truckroll>' |
| .config(function($httpProvider){ |
| $httpProvider.interceptors.push('NoHyperlinks'); |
| .directive('truckroll', function(){ |
| templateUrl: 'templates/truckroll.tpl.html', |
| controller: function($timeout, $log, Subscribers, Truckroll){ |
| Subscribers.query().$promise |
| this.subscribers = subscribers; |
| delete this.truckroll.result; |
| delete this.truckroll.is_synced; |
| delete this.truckroll.result_code; |
| delete this.truckroll.backend_status; |
| const test = new Truckroll(this.truckroll); |
| this.waitForTest(res.id); |
| this.waitForTest = (id) => { |
| Truckroll.get({id: id}).$promise |
| testResult.backend_status.indexOf('2') >= 0 || |
| (testResult.result_code && testResult.result_code.indexOf('2') >= 0) || |
| this.truckroll = angular.copy(testResult); |
| Truckroll.delete({id: id}); |