I'm trying to pass a ngModel to a function and get the change,

I don't know the way to use.

this is what I got now:

```
          <ion-input text-right
               formControlName="monday"
               type="number" pattern="[0-9]*"
               placeholder="00.00"
               [(ngModel)]="monday"
               (keypress)="onChange(monday)">
           </ion-input>

           <ion-input text-right
               formControlName="tuesday"
               type="number" pattern="[0-9]*"
               placeholder="00.00"
               [(ngModel)]="tueasday"
               (keypress)="onChange(tuesday)">
           </ion-input>

```

.... and so on...

Then in my page.ts I got

```
monday: string = '';
tuesday: string = '';
etc...

onChange(input: string){
//I want the input to correspond to my ngModel so it gets updated
    input = this.clientAction.transformInput(input);
}

```

I don't want to do:

```
this.monday = this.clientAction.transformInput(input);

```

Because as you may think I got all the day of the week so I don't want to have a function for every day like:

```
onChangeMonday(){};
onChangeTuesday(){};

```

I need something dynamic.

How can I resolve this issue?

Thanks in advance

**[SOLUTION]** @AJT\_82

instead of using my ngModel and trying to update it, the solution was to access the controls from the form.

in your page.html

```
      <ion-input text-right
           formControlName="monday"
           type="number" pattern="[0-9]*"
           placeholder="00.00"
           [(ngModel)]="monday"
           (keypress)="onChange(monday, 'monday')">
       </ion-input>

```

then in your page.ts

```
onChange(input: string, day: string){
this.rateForm.controls[day].setValue(this.clientAction.transformInput(input));
}

```

works like a charm now !!
**Thanks @AJT\_82**