Search code examples
angularangularjs-directiveangular-routing

Angular -Binding Error: Can't bind to 'ngIf'


I have tried to solve this issue without having success. It's strange becuase this the module that return teh issue is the replica of another one that works fine.

I have shared the folder on gitHub - I will be happy if somebody can help me to figure how to fix it.

Thank you so much P.

enter image description here


Solution

  • Use ? in interpolation object variable in your HTML Tag as shown below in the code.

    It is shorthand to write as (card || {}).titleHeader

    <h2>{{ card?.titleHeader }}</h2>