Can’t bind to ‘ngIf’ since it isn’t a known property of ‘div’ in production build

I had exactly the same error, and I had included both CommonModule and BrowserModule and yet I still saw the same error message on my browser.

Finally, I found the cause of my problem was that I forgot to add my component to app.module.ts, in case someone else is dealing with the same behavior.

EDIT: this problem can be solved also by adding the component to one of the modules imported by app.module.ts.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)