0

I am using Ternary Conditional Operator in my angular project, but when I am trying to pass HTML tag inside condition I am getting an error, how to resolve it, Code -

{{!status.available ? 'Inactive' : 'Active'}}

this code is working fine but when I try to pass -

{{!status.available ? '<span>Inactive</span>' : 'Active'}}

Getting this error on client side - {{!status.available ? '' : 'Active'}} I want to display - Inactive/active only

1 Answers1

0

you can try to do like this :

<span>
{{!status.available ? 'Inactive' : 'Active'}}
</span>
  • hi, @othmane I want to pass link - {{!status.available ?Inactive' : Active}} I have to pass data (active/inactive) inside HTML tage – Rahul Singh Jul 24 '22 at 21:20