Skip to content

Current DevTools Example Throws TypeError: this.$eval is not a function at $apply #117

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

Closed
ClayChristmas opened this issue Dec 13, 2016 · 4 comments

Comments

@ClayChristmas
Copy link
Contributor

The current Redux-DevTools example in the readme file throws the following exception whenever a new state occurs: TypeError: this.$eval is not a function. Removing the $rootScope.$apply call fixes this exception from occurring.

@zoamel
Copy link

zoamel commented Dec 19, 2016

Same error in my case, unfortunately removing $rootScope.$apply brokes app refreshment when playing with redux dev tools

@ClayChristmas
Copy link
Contributor Author

I figured out a fix this morning for this. I'm planning on doing a PR with a fix for it as well as some other info on using the chrome devtools extension instead of including react and everything in your app. The devtools extension is way better than the embedded one that is currently being used.

The fix to stop the $eval errors from the console is to pass a function to the call to $apply. Here is what the new code looks like:
$ngRedux.subscribe(() => { $timeout(() => {$rootScope.$apply(() => {})}, 100); });

@ClayChristmas
Copy link
Contributor Author

PR Created here that includes the fix and shows how to use Redux DevTools Extension instead of the npm package. The extension provides more functionality and can sit in the chrome dev tools under a tab or be docked, so it doesn't compete with your screen realestate.

@wbuchwalter
Copy link
Member

Thanks!

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

3 participants