[Fix] Class is using Angular features but is not decorated. Please add an explicit Angular decorator

The Error “Class is using Angular features but is not decorated. Please add an explicit Angular decorator”, is an error that is invoked when you are working on angular and are trying to use the angular features after you have recently updated your angular app from version 13 to 14.

Given below is the snippet of the error you might get:

Class is using Angular features but is not decorated. Please add an explicit Angular decorator

The error, “Class is using Angular features but is not decorated. Please add an explicit Angular decorator” is seen due to the Angular Language Service extension, where TypeScript 4.8 and 4.7.4 versions are not yet supported.

For more information, see this linked issue in the documentation here.

For a simple fix you can stop using the current version of angular app and downgrade to the previous stable version 13, also typescript to version 4.7.2 and error would be fixed.

To fix the error, “Class is using Angular features but is not decorated. Please add an explicit Angular decorator” downgrade the typescript dependencies using command @typescript-eslint/eslint-plugin”: “5.29.0” and “typescript”: “4.7.2”, now error would be fixed.

You will have to downgrade the typescript dependencies in your project file by following the code mentioned below:

"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"typescript": "4.7.2"

Another fix is to stop using the current version of the angular app and downgrade to the previous version of angular app that is version 13.

This should help you fix the error, “Class is using Angular features but is not decorated. Please add an explicit Angular decorator”.

Conclusion

To fix the error, “Class is using Angular features but is not decorated. Please add an explicit Angular decorator” you will have to downgrade to the typescript dependencies by following the code correctly.