-
Notifications
You must be signed in to change notification settings - Fork 172
Use $evalAsync instead of $apply to make sure ngModel gets updated once editor content changes #77
Conversation
Build failure was introduced before my change. |
👍 👍 |
Make sense! |
ui-ace declare a dependency on Angular |
@PowerKiKi I have updated angularjs dependency in bower.json and readme. The build is failing, I'll try to fix it. |
I am not sure what to think of that. Specifying a devDependency on @douglasduteil would you have an opinion on this ? |
Finally I figure this out. From Angular-mocks 1.3.1 (and AngularJS 1.3.x), we have to provide the
@PowerKiKi I have just reverted |
Hi |
@douglasduteil good to know you can have a look at this repo. I'll keep updating this pr if I find better ways to get rid of build failure and this bug. |
Currently we are using
!scope.$$phase && !scope.$root.$$phase
to avoid to call$apply
if there is already a digest loop running. ThengModel
binded to editor content would not get updated until users modify the content once again. If users try to access thengModel
binded to editor content, he would get an incorrect answer.We can push our
ngModel
updating task into$evalAsync
queue.It would be executed before rendering the DOM and it won't conflict with digest loop.Attach angularjs event loop workflow.
Thanks.