I am building and AngularJS app using ES6 classes with traceur transpiling to ES5 in AMD format.
in my module I import the interceptor class and register it as a service
export default class AuthInterceptor{
/*@ngInject;*/
constructor(SomeService,$q){
this.$q=$q;
this.someSrv = SomeService;
this.request = (config) =>{
...
this.someSrv.doit();
return config;
}
this.response = (response)=>{
...
this.someSrv.doit();
return response;
}
this.responseError = (response) => {
...
return this.$q.reject(response);
}
}
}