Accepting multiple inputs from one textbox in angular

I am stuck when trying to accept input as an array in angular here is my code

 <input type="number" [(ngModel)]="valuesArray">

 <button (click)="PerformAction()" > find</button>
 valuesArray=[];

 PerformAction(){
    var results =this.valuesArray[0]-this.valuesArray[1]
    console.log(results);
 }

I get nothing at the console. Can someone please help me?



Read more here: https://stackoverflow.com/questions/64960103/accepting-multiple-inputs-from-one-textbox-in-angular

Content Attribution

This content was originally published by Awabil George at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: