🐞 bug report
Not sure maybe @angular/compiler
Is this a regression?
Angular 9.1 did not enforce this, although its deprecated as far as i know
We use lot of inheritance based components, most base class uses angular features such as `@ViewChild`, in Angular 9 it works fine without adding any decorators to base class, as i understand from Angular 10 onwards, it enforces to have decorator on any class using Angular features, if not it will throw error during compilation:
error NG2007: Class is using Angular features but is not decorated. Please add an explicit Angular decorator
What’s weird is, we updated our project from Angular 9 to Angular 10, it did not complain about it when buildlng, even the base classes does not have any decorator. And migration did not add any decorate as well. Angular features such as
@ViewChild still works in some base classes (well, long story short some class does not evaluate
@ViewChild, thats reason we update to 10, anyway very long story.)
🔬 Minimal Reproduction
Cannot reproduce on new project, only happens to the project im working on.
🔥 Exception or Error
It supposes to throw error
error NG2007: Class is using Angular features but is not decorated. Please add an explicit Angular decorator, however it DID NOT.
🌍 Your Environment
Angular CLI: 10.2.1 Node: 10.15.2 OS: win32 x64 Angular: 10.2.4 ... animations, common, compiler, compiler-cli, core, forms ... language-service, localize, platform-browser ... platform-browser-dynamic, router Ivy Workspace: Yes Package Version --------------------------------------------------------- @angular-devkit/architect 0.1002.1 @angular-devkit/build-angular 0.1002.1 @angular-devkit/core 10.2.1 @angular-devkit/schematics 10.2.1 @angular/cdk 10.2.7 @angular/cli 10.2.1 @angular/material 10.2.7 @schematics/angular 10.2.1 @schematics/update 0.1002.1 rxjs 6.5.5 typescript 4.0.5
Anything else relevant?
The reason we upgrade to Angular 10 is because this issue