I integrated the primeNg p-switch component into my Angular 2 project. By default, the input switch's values are boolean. However, I would like to have the values set to 'N' or 'Y' instead of true or false.
@export class MyComponent{
persons: Person[] = [{'name':'Marvin','legalAge': 'Y'}, {'name':'Carla','legalAge': 'N'} ] }
Here is an example implementation in the HTML template:
<p-dataTable [value]="persons">
<p-column field="name" header="Name"></p-column>
<p-column field="legalAge" [sortable]="true" header="is Legal Age?">
<template let-l="rowData" pTemplate>
<p-inputSwitch [(ngModel)]="l"></p-inputSwitch>
</template>
</p-column>
</p-dataTable>