Im using angular-ui-mask for SSN, the initial ui-mask is "999-99-9999", but on blur I need to display the SSN 123-45-6789 characters as XXX-XX-6789.

I tried setting ui-mask as XXX-XX-9999 but it's showing the first 4 digits of the SSN at the end of 'XXX-XX-' instead of the last four digits.

Here's the HTML Code

```
<input class="btnDropdown" id="phoneTextInput" ui-mask="{{uimaskpattern}}" ui-mask-placeholder-char=""
  ng-focus="applymask()"
  ng-blur="removemask(contact.contactDetails.attributeDetails.contact)"

  md-minlength="10" md-maxlength="10" name="Phone_{{$index}}" ng-model="contact"
  placeholder="">

```

Here's the Typescript code

```
public applymask() {
    this.uimaskpattern = "999-99-9999";

}

public removemask(ssn, ev) {
    if (ssn) {
        console.log(ssn);
        this.uimaskpattern = "AAA-AA-9999";
    }
}

```