0

I have two contenteditable having same ng-model when I cut or copy or paste any selection using keyboard shortcut both contenteditable get updated but if I use document.execCommand() ng-model not get updated, it only work for active contenteditable.

<div ng-model="test" contenteditable="true"></div>
<div ng-model="test" contenteditable="true"></div>


$scope.cutSelection= function(){ 
    document.execCommand("cut");

} //only work for active contenteditable

I am not getting any error it just not updating inactive contenteditable

Pratyush Pranjal
  • 544
  • 6
  • 26
  • Possible duplicate of [document.execCommand doesn't work in angularJS](https://stackoverflow.com/questions/28781241/document-execcommand-doesnt-work-in-angularjs) – Zooly Sep 12 '17 at 12:02
  • I am not getting any error, it just not updating ng-model. – Pratyush Pranjal Sep 12 '17 at 12:04
  • Then maybe this one: https://stackoverflow.com/questions/42624450/execcommand-is-not-working-with-angularjs – Zooly Sep 12 '17 at 12:05

0 Answers0