Check out example codes for "ionic pasword visible inside ion-input". It will help you in understanding the concepts better.

Code Example 1

public showPassword: boolean = false;
public showHide(): void
{
	this.showPassword = !this.showPassword;
}

...

<div class="col-12 placeholder">
  <ion-input [type]="showPassword ? 'text' : 'password'" class="col-12" placeholder="Senha" [(ngModel)]="pwd"></ion-input>
  <ion-icon [name]="showPassword ? 'eye-off' : 'eye'" (click)="showHide()"></ion-icon>
</div>

Code Example 2

<ion-input formControlName="password" type="password"></ion-input>

Learn ReactJs, React Native from akashmittal.com