'valuechanges does not work if you add a plus symbol before a number in a numeric input

i am trying to make my controller and one of the requirements. prohibition of entering any characters.

why is valuechanges not working if I add a plus sign in front of a number in a number input.

I track changes in my input. let's say the value of the input is 228.at the following changes valuechanges handles value changes:

-228 228- 228+ 2+28

+228 but if so. then valueChanges won't work

is there a way to track this?

this.calculatorForm.get('sendAmount').valueChanges.subscribe( newValue => {
  const test = /[^,.0-9]/.test(newValue);
})


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source