lauripiispanen / angular-bacon

Angular-bacon.js bindings
MIT License
146 stars 16 forks source link

add extra $$digest check for isolated scopes #17

Closed kristw closed 9 years ago

kristw commented 9 years ago

I found the multiple digest calls issue after trying to use angular-bacon functions in a directive. Updating Line 31 in the .coffee fix it.

lauripiispanen commented 9 years ago

Thanks, this looks useful. I'll merge it, but I'm having some difficulties isolating this particular case in a test case. Can you tell me a bit more on directive you're using? Are you using an isolate scope with your directive? What does your stream look like?

kristw commented 9 years ago

I am using this in a big project so I couldn't extract the code to reproduce quickly, but, in short, I have an isolate scope within a directive. I use angular-bacon in both the controller of the page that contains the directive and within the directive itself.

When open, the controller load data and digest it as well as passing the data to directive, which process and try to digest as well. I think that's where the problem occur because the controller (parent scope) has already call digest, then the isolate scope try to call digest when the former is in progress.