I am using Angular2 to restrict the copy and paste in textbox. But how do i write a custom directive, so that it will be easy to apply for all the text fields.
Below is the working code to restrict the copy and paste functionality.
<ion-input formControlName="confirmpass" type="tel" (cut)="$event.preventDefault()" (copy)="$event.preventDefault()" (paste)="$event.preventDefault()"></ion-input>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…