Check out example codes for "ionic input mask". It will help you in understanding the concepts better.

Code Example 1

npm install br-mask --save -E

...

import { BrMaskerModule } from 'br-mask';

@NgModule({
  imports: [
    BrMaskerModule
  ],
})

...

<ion-input 
	type="text" 
    name="cpf" 
    placeholder="CPF" 
    [brmasker]="{mask:'000.000.000-00', len:14}">
</ion-input>

Learn ReactJs, React Native from akashmittal.com