0

On our team we build lots of universal packages (No angular dependency). The classes in these packages are decorated with our own @injectable decorator and we have TS emitting metadata for types.

"experimentalDecorators": true

In Angular 7 apps we interop with with Angular to provide the dependnecy injection, and outside of Angular we construct the dependencies ourselves using reflect-data. We interop with Angular using the module providers.

providers: [..allTheTypesWeCapturedWithOurDecorator]

Question? I have seen a lot a about injectables in IVY working differently (inline factories etc), I am trying to understand if we we will still be able to inject our universal services once IVY goes live?

CompareTheMooCat
  • 1,047
  • 2
  • 10
  • 14

1 Answers1

0

It turns out that yes IVY compiler will work fine with Inejctables from other packages (non-angular). I was able to enable the IVY compiler in one of our Angular 7 apps and it all functioned as expected.

You can enable the compiler in the tsconfig with the following setting

"angularCompilerOptions": {
  "enableIvy": true
}
CompareTheMooCat
  • 1,047
  • 2
  • 10
  • 14