I'm using ng-paste
and onpaste
like this,
<input type="text" class="form-control" ng-trim="false" ng-model="x.value" select-on-click ng-paste="paste($event, x)" onpaste="return false;" id="input{{$index}}"
The input
has text some<CURSOR>data
(where the <CURSOR>
represents the position of the cursor)
When I press Cmd + V the paste event is called,
$scope.paste = function(event, data) {
console.log('paste event', event);
}
It works, but I can only get the pasted text, what I want is some<PASTED DATA>data
, any ideas?
P.S I had to use onpaste="return false;"
, otherwise the text become <PASTED DATA><PASTED DATA>