my code in html:
<Switch col="2" row="0" class="switcher" color="#FFFFFF" backgroundColor="#DCA44F" offBackgroundColor="#B8B8B8"
checked="{{isNightlyMode}}" (checkedChange)="onCheckedChange()"></Switch>
when the begin value of isNightlyMode = false -> everything is ok. if the begin value of isNightlyMode=true, drop an error and doesnt load my page:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'getTrackDrawable' of undefined
JS: TypeError: Cannot read property 'getTrackDrawable' of undefined JS: at Switch.setNativeBackgroundColor (file: src/webpack:/libri-app/node_modules/@nativescript/core/ui/switch/index.android.js:48:0) JS: at Switch._onCheckedPropertyChanged (file: src/webpack:/libri-app/node_modules/@nativescript/core/ui/switch/index.android.js:61:0) JS: at onCheckedPropertyChanged (file: src/webpack:/libri-app/node_modules/@nativescript/core/ui/switch/switch-common.js:22:0) JS: at Switch.Property.set [as checked] (file: src/webpack:/libri-app/node_modules/@nativescript/core/ui/core/properties/index.js:178:0) JS: at CheckedValueAccessor.writeValue (file: src/webpack:/libri-app/node_modules/@nativescript/angular/fesm2015/nativescript-angular.mjs:4993:8) JS: at onChange (file: src/webpack:/libri-app/node_modules/@angular/forms/fesm2015/forms.mjs:3172:26) JS: at file: src/webpack:/libri-app/node_modules/@angular/forms/fesm2015/forms.mjs:3658:49 JS: at Array.forEach () JS: at FormControl.setValue (file: src/webpack:/libri-app/node_modules/@angular/forms/fesm2015/forms.mjs:3658:27) JS: at file: src/webpack:/libri-app/node_modules/@angular/forms/fesm2015/forms.mjs:4147:25
my code in .ts file:
onCheckedChange() {
this.isNightlyMode = ! this.isNightlyMode;
console.log('nightly '+this.isNightlyMode);
}
What can I do?