Steven Dieu
Steven Dieu

Reputation: 75

How to have different value between model and input box (Angular 5)

I have an application in Angular 5, and I need to have an input formatted with thousand separators (space), but my model is a number and don't allow spaces (number expected).

My application is already developped and I don't want to change all typescript, I only want to create a directive or pipe.

Example like i want :

enter image description here

Is it possible to have a different model of Input box ?

Version :

Steven

Upvotes: 1

Views: 394

Answers (1)

hamid_reza hobab
hamid_reza hobab

Reputation: 929

you can create an loval variable and bind to your input. then in change event of input box cast variable to your model.

if this is helpfull tell me.

Upvotes: 1

Related Questions