Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtForm and UI Bootstrap $apply already in progress #40

Open
larixer opened this issue May 12, 2015 · 3 comments
Open

xtForm and UI Bootstrap $apply already in progress #40

larixer opened this issue May 12, 2015 · 3 comments

Comments

@larixer
Copy link

larixer commented May 12, 2015

When you try to run UI bootstrap popup datepicker (https://angular-ui.github.io/bootstrap/) inside xtForm form it will result in the following error:

Error: [$rootScope:inprog] $apply already in progress
http://errors.angularjs.org/1.3.15/$rootScope/inprog?p0=%24apply
at REGEX_STRING_REGEXP (angular.js:63)
at beginPhase (angular.js:14820)
at Scope.$get.Scope.$apply (angular.js:14564)
at HTMLInputElement. (xtForm.tpl.js:58)
at HTMLInputElement.jQuery.event.dispatch (jquery.js:4435)
at HTMLInputElement.jQuery.event.add.elemData.handle (jquery.js:4121)
at Scope.link.scope.dateSelection (ui-bootstrap-tpls.js:1632)
at $parseFunctionCall (angular.js:12404)
at Scope.$get.Scope.$eval (angular.js:14466)
at angular.js:20672

@idreeshaddad
Copy link
Contributor

@Vlasenko Could you replicate that in http://plnkr.co/ ?

@smurugavel
Copy link

I was able to reproduce this problem in Chrome + Angular 1.3, Angular ui 0.13.3 + xtform. Not sure if this was a xtform problem but could be due to Angular ui 0.13.3. A previous version of angular ui did not have this problem.

Eitherway, due to complexity and performance i noted in Angular ui datepicker, I am moving on to AngularStrap.

@peng-at-gruden
Copy link

@Vlasenko I was running into the same issue. Changing the xtForm.js line 58 do the trick for me:
scope.$apply() => scope.$evalAsync()

$evalAsync takes a function and schedules it to run later but still during the ongoing digest. Also $evalAsync triggers a digest when there is no one is running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants