Error while doing ng Prod build for angular 2 project

Viewed 570

I have a angular2 project, whenever I try to serve the project or build it, it works fine (creates a dist folder for the ng build command), but whenever I try to build the same project with prod tag turned on (ng build --prod), the compilation fails with a lot of similar error(Property 'XXX' does not exist) like below,

ERROR in ng:///C:/Users/username/Desktop/Latest/ang-project/ui/src/app/components/full-
header/full-header.component.html (12,22): Property 'Test' does not exist on typ
e 'FullHeaderComponent'.

I seem to remember that the prod flag makes use of aot compilation internally - is it so?

If it does use aot, should I be enabling the AOT in my project(And if yes how should I be doing it?)

1 Answers
Related