class ThingFactory {
/*@ngInject*/
constructor($timeout) {
this.$timeout = $timeout;
}
newThing() {
console.log('Getting a new Thing...');
return this.$timeout(() => new Thing(), 100);
}
}
register('app').factory('thingFactory', ThingFactory);
In my app, newThing() doesn't have access to ThingFactory object's this. Rather this points to window.