I'm trying to prevent pasting into a textbox using ng-paste in angular2 by cancelling the paste event. I got this to work in angularJS but not in angular2. Am I doing something wrong or does it not work in angular2?
<input type="text" #username class="form-control" id="username" required
placeholder="Username" value="{{userName}}" ng-paste="$event.preventDefault()">
use (paste)="$event.preventDefault()" or (paste)="false".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With