akatov / angular-contenteditable

angular model for the "contenteditable" attribute
http://akatov.github.io/angular-contenteditable/
MIT License
176 stars 55 forks source link

Error: [$rootScope:inprog] $digest already in progress #21

Closed bettysteger closed 10 years ago

bettysteger commented 10 years ago

I'm using ng-focus on my element:

    <div contenteditable="true"
          ng-model="target"
          ng-focus="showMeta()"
          ng-blur="saveIt()">
    </div>

Don't know why but I'm getting an error: Error: [$rootScope:inprog] $digest already in progress

bettysteger commented 10 years ago

I know what the problem is, somehow in chrome the first contenteditable element gets focused automatically!

or do you set the focus?

bettysteger commented 10 years ago

FYI I installed it per bower and use version 0.3.6

got an solution, had to change line 67 from

sel.addRange(range)

to

if(!$scope.$$phase) { sel.addRange(range) }
akatov commented 10 years ago

presumably fixed by 9a1471d23c726cf043727a8774e3094714193df2