Closed Sathishchary closed 7 years ago
Hello @Sathishchary what version of this library and angular CLI are you using ?
@JulioWar I am using below versions: "jw-bootstrap-switch-ng2": "^1.0.4", angular/cli: 1.0.0 angular : 4.0.0
@Sathishchary
I can't see something wrong in your code, just a few things like:
But a I don't think those things are the problem.
This is the repository for the demo if you want to check it : https://github.com/JulioWar/jw-bootstrap-switch-demo.
If you can replicate the issue in a isolate respository or something like that and I can check it.
Thanks for the demo @JulioWar , I have download it ,its working, I have compared the demo code with my code. the problem with my css only. its overriding some check box css. I removed that, now its working perfectly.
Hi
I have added this plugin in my Angular CLI project. I am able to see the UI of the switch, And the button is enabling and disabling when i drag the 'ON' to 'OFF', but if I click on the 'ON' or 'OFF', its not showing anything, and not working correctly, In the DEMO it's working for the drag and click.
Added like this in app.module file: import { JWBootstrapSwitchModule } from 'jw-bootstrap-switch-ng2'; imports : [JWBootstrapSwitchModule ]
component : export class SwitchComponent implements OnInit { public labelText: string = ""; public inverse: boolean = false; public baseClass: string = "bootstrap-switch"; public onText: string = "ON"; public offText: string = "OFF"; private _onColor: string = "primary"; private _offColor: string = "default"; public calldisabled: boolean = false; public callreadonly: boolean = false; public size = 'normal'; callanimate = true; constructor() { } enableAction(event: any){ console.log(event); } }
html code: <bSwitch [switch-base-class]="baseClass" [switch-wrapper-class]="wrapperClass" [switch-off-text]="offText" [switch-on-text]="onText" [switch-on-color]="_onColor" [switch-off-color]="_offColor" [switch-size]="size" [switch-disabled]="calldisabled" [switch-readonly]="callreadonly" [switch-animate]="callanimate" formControlName="callACtion" (onChangeState)="enableAction($event.currentValue)">