ngModel on number input

Viewed 3930

I'd like to bind the input of a number input to a variable in my typescript file. I thought ngModel would be appropriate and made an input: <input [{ngModel}]="tRating" type="number" min="1" max="10"> tRating being of type number in the .ts file. Unfortunately I'm getting an error :

Can't bind to '{ngModel}' since it isn't a known property of 'input'. ("   
        <input [ERROR ->][{ngModel}]="pRating" type="number" min="1" max="10">
2 Answers
Related