Hi I am working in Angular and in one of the field which is phone number ,I want to mask the string on HTML view only except the last 3 characters. How can I do that ?
Example: - 1212121212 as XXXXXXX212 or *******212
Note: - Only in view I need to show masked. The field is editable and I am patching pre defined value. Once I input new value then mask must not show
<input matInput placeholder='{{"PhoneNumber" | translate}}' formControlName="mobilenumber"
class="form-control" numbersOnly maxlength="10" minlength="10" required autocomplete="off"
pattern="[6789][0-9]{9}" title="Please enter valid phone number" inputmode="numeric">
To use in a FormControl you need know when is focus and when not then you can use some like
Imagine you has a variable "caracteres" and a FormGroup
You can to have some like