ovsleep / bootstrap-switch

This is a Angular 2 Component to add a switch like input.
https://bootstrap-switch.herokuapp.com/
8 stars 10 forks source link

Change event #4

Closed somnathswami closed 7 years ago

somnathswami commented 7 years ago

I have successfully implement this component but i cannt trace its change event in my typescript file

i am using <switch [status]=false [onText]="onText" [offText]="offText" [onColor]="onColor" [offColor]="offColor" [size]="size" (change)="onSwitchChange();"> code and written definition onSwitchChange() in typescript file but it wont work

ovsleep commented 7 years ago

The reason this isn't working is that the name of the event is "statusChange". I should've used just change though. Anyway, if you do it like this should work:

<switch [status]=false [onText]="onText" [offText]="offText" [onColor]="onColor" [offColor]="offColor" [size]="size" (statusChange)="onSwitchChange()">

Notice the change form (change) to (statusChange)

somnathswami commented 7 years ago

Hello Guillermo Pérez,

Thanks it really helps me

Regards Somnath