Ionic 2 dynamically want to masking phone number based on country code

I want to change dynamically the masking pattern for phone number based on the country code. So the problem which I faced is I couldn’t able to find examples for this masking in ionic 2. I tried with example, this is work with input element. But the problem is I want to mask the ion-input dynamically. Please suggest me solution for this problem. Appreciate your help…

Perhaps you can adapt this pattern to your needs.