Can somebody provide me with an example of how I can create an Angular Filter in TypeScript that uses dependency injection. At the bottom is what I currently have, which is
You can use classes to inject dependencies, just use the [] in the module and use method injection as below:
module Filters {
export class MyFilter {
public static Factory(injectableService: InjectableService) {
return function (input:any) {
// use injectableService to affect your input in desired way
return input;
}
}
}
angular.module('app')
.filter('myFilter', ['injectableService', MyFilter.Factory]);