feat(ngcc): migrate services that are missing @Injectable() (#33362)

A class that is provided as Angular service is required to have an
`@Injectable()` decorator so that the compiler generates its injectable
definition for the runtime. Applications are automatically migrated
using the "missing-injectable" schematic, however libraries built for
older version of Angular may not yet satisfy this requirement.

This commit ports the "missing-injectable" schematic to a migration that
is ran when ngcc is processing a library. This ensures that any service
that is provided from an NgModule or Directive/Component will have an
`@Injectable()` decorator.

PR Close #33362
This commit is contained in:
JoostK
2019-10-20 20:40:48 +02:00
committed by Andrew Kushnir
parent 0de2dbfec1
commit 31b9492951
8 changed files with 1082 additions and 137 deletions

View File

@ -16,3 +16,4 @@ export {InjectableDecoratorHandler} from './src/injectable';
export {NgModuleDecoratorHandler} from './src/ng_module';
export {PipeDecoratorHandler} from './src/pipe';
export {NoopReferencesRegistry, ReferencesRegistry} from './src/references_registry';
export {forwardRefResolver} from './src/util';