core.js:12853 Can't bind to 'ngIf' since it isn't a known property of 'div'

I am using Angular 9.

and I am having a use case of loading dynamic components

In one of my component, I am getting the warning

core.js:12853 Can’t bind to ‘ngIf’ since it isn’t a known property of ‘div’

I have included commonModule in my app.module.ts

enter image description here

This is my component where I am using ngIf

enter image description here

and here is the object I am getting in my above component

enter image description here

Any Suggestions I have already included CommonModule and also tried using an extra boolean variable.

43 thoughts on “core.js:12853 Can't bind to 'ngIf' since it isn't a known property of 'div'”

Leave a Comment