Implementing this feature is a great way to learn Reflect API and Typescript decorators. I've provided link to a great article on this topic.
Typescript Decorators and Reflect API
- Use Reflect API to simplify injection syntax.
- That can only be possible with Typescript, don't try to apply this feature to es5+.
- Update docs according to this feature.
@Injectable()
class AppService {
constructor(private http: HttpService) {} // instead of @Inject(HttpService) private http: HttpService
}
@Injectable()
class HttpService {
}
container.register([HttpService, AppService])