In the process of migrating an Angular 1 project from JavaScript to TypeScript, I am looking to enhance the overloaded $injector.get method by adding the project's own injectable types. After reading through this TypeScript documentation on merging interfaces, I made changes in an imported d.ts file:
import TrendDisplayService from 'services/TrendDisplayService';
declare namespace angular {
export module ng.auto {
export interface IInjectorService {
get(name: 'trendDisplayService'): TrendDisplayService
}
}
}
Despite this modification, I am encountering a "not assignable" type error when attempting the following:
let trend:TrendDisplayService = $injector.get('trendDisplayService');
Any insights or suggestions?