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

Cannot read property 'toString' of null at BootstrapSwitchComponent.ngOnChanges #22

Open SahilParmar123 opened 6 years ago

SahilParmar123 commented 6 years ago

Hi i got this error in BootstrapSwitchModule. My code is :- maintenanceMode = true or false; <switch [status]="maintenanceMode" name="maintenanceMode" [(ngModel)]="maintenanceMode" #maintenanceMode="ngModel" [onText]="'ON'" [offText]="'OFF'" [onColor]="'blue'" [offColor]="'gray'" [size]="size" [disabled]="disabled" (statusChange)="value = !value" ngDefaultControl>

and the error after the submit for the update values.

GeneralSettingComponent.html:555 ERROR TypeError: Cannot read property 'toString' of null at BootstrapSwitchComponent.ngOnChanges (angular2-bootstrap-switch.umd.js:172) at checkAndUpdateDirectiveInline (core.js:12365) at checkAndUpdateNodeInline (core.js:13893) at checkAndUpdateNode (core.js:13836) at debugCheckAndUpdateNode (core.js:14729) at debugCheckDirectivesFn (core.js:14670) at Object.eval [as updateDirectives] (GeneralSettingComponent.html:555) at Object.debugUpdateDirectives [as updateDirectives] (core.js:14655) at checkAndUpdateView (core.js:13802) at callViewAction (core.js:14153)

please help.. thanks