vendredi 8 octobre 2021

Use trueValue/falseValue on p-checkbox on PrimeNG

I'm trying to implement a p-checkbox on Angular8 with true and false value as string and not as boolean. So I tried this code below

<p-checkbox [(ngModel)]="mycheckbox" name="mycheckbox" inputId="mycheckbox" [trueValue]="'CB_OUI'" [falseValue]="'CB_NON'"></p-checkbox>

but I always get this error message : Can't bind to 'trueValue' since it isn't a known property of 'p-checkbox'. but I don't understand why because in the doc there are trueValue and falseValue...

If anyone has an idea, thx for your help.




Aucun commentaire:

Enregistrer un commentaire