Ngx-bootstrap: Use booleans with btnRadio

Created on 23 Jul 2016  路  2Comments  路  Source: valor-software/ngx-bootstrap

Is it somehow possible to use a boolean with btnRadio instead of a string?

E.g. btnRadio="true" sets ngModel to true instead of "true"?

Most helpful comment

Just for docoumentation purposes:
This now works (current v1.3.3) when using [btnRadio]="true|false" binding.

All 2 comments

Since it could have more than two sates, the property is defined as string @Input() private btnRadio:string, so I don't see any option of using it as boolean.

You could however just convert it to a bool, or expose in your component a different property that just returns model == 'true';

Just for docoumentation purposes:
This now works (current v1.3.3) when using [btnRadio]="true|false" binding.

Was this page helpful?
0 / 5 - 0 ratings