-2

I have 2 pages.In first page i will fill my mobile number.Then,navigating to the second page I will show the mobile number in read only.In that i need to show the number like xxxxxx1234. If user clicks the edit button then,it should show all the numbers like 8790561234.

I couldn't get the masking for read only field.?Any suggestions??

1
  • 2
    what you had tried so far?? Commented May 18, 2017 at 12:25

1 Answer 1

2

With slice and replace, you can achieve what you want:

var orig = scope.ngModel;
    var edited = orig;
    scope.ngModel = edited.slice(4).replace(/\d/g, 'x') + edited.slice(-4);

Check out this similar Plunker.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.