V
V
Vitaly2017-01-12 15:15:22
Angular
Vitaly, 2017-01-12 15:15:22

How does Inject work in Angular 2?

I'm trying to understand how decorators manage to call the component's constructor with the right services in the right order, guided by the enumeration of arguments in the constructor itself. Is there an additional preprocessor involved here, or can this be repeated using TypeScript?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2017-01-12
@vitali1995

Inject is based on reflect-metadata
This is an additional JS library, more precisely Metadata Reflection is one of the ES7 APIs, and reflect-metadata is a polyfill

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question