I'm having problems when i try to get the pasted data using ng-paste directive.
<input ng-model="evidence.url" ng-paste="getEvidenceInfos(evidence, $event.clipboardData.getData('text/plain'))">
When the jquery is loaded after angular, it works fine.
How to do when jquery is loaded before angular ?
<input ng-model="evidence.url" ng-paste="getEvidenceInfos(evidence, $event)">
$scope.getEvidenceInfos = function(evidence, event) {
$(event.currentTarget).val() // doesn't work
$(event.target).val() // doesn't work
}
When jQuery is loaded before angular, it is used within angular instead of jQuery lite which is built into angular. If full jQuery is used, you will receive a jQuery event. The raw event can be found in the property originalEvent.
$scope.getEvidenceInfos = function(evidence, event) {
var pastedData = event.originalEvent.clipboardData;
}
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