onchange equivalent in angular2

Discussão em 'Angular' iniciado por PrinceZee, Março 24, 2025.

  1. PrinceZee

    PrinceZee Guest

    i'm using onchange to save the value of my input range into firebase , but i have an error who say that my function is not defined.

    this is my function

    saverange(){
    this.Platform.ready().then(() => {
    this.rootRef.child("users").child(this.UserID).child('range').set(this.range)
    })
    }


    this is my html

    <ion-item>
    <ion-row>
    <ion-col>Rayon <span favorite><strong> {{range}} km</strong></span></ion-col>
    <ion-col><input type="range" name="points" min="0" max="40" [(ngModel)]="range" onchange="saverange()"></ion-col>
    </ion-row>
    </ion-item>


    what is the equivalent of onchange in angular , if one exist. thank you

    Continue reading...

Compartilhe esta Página