hello, i am using this element https://ko.infragistics.com/products/ignite-ui-angular/angular/components/switch.html, Could someone help me with an example of how to execute a method in the change event.
Hello Erick,
I am glad that you find my suggestion helpful and were able to solve your issue.
Thank you for using Infragistics components.
Regards,
Monika Kirkova,
Infragistics
Thank you very much, this solves it.
After investigating this further, I determined that your requirement could be achieved by binding a method to the change event the following way:
<igx-switch checked="true" (change)="stateChanged($event)">
The method stateChanged is defined in the ts file:
public stateChanged(evt){
if(evt.checked)
console.log("Switch is now checked!");
else {
console.log("Switch is now unchecked!");
}
I have prepared a sample, demonstrating the described behavior. Please test it on your side and let me know if you need additional information regarding this matter.