-
Notifications
You must be signed in to change notification settings - Fork 107
Adapter is not assigned to $rootScope when compileProvider.debugInfoEnabled is set to false #132
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
Comments
@adybionka Looks like we need to review a mechanism of the target scope injection. This may require time. Right now I don't see appropriate workaround. Thanks fo report! |
I've encountered another problem related with the scope injection mechanism. If I use controller as syntax sometimes adapter is assigned to proper scope, but sometimes not. Everything depends of scopes hierarchy. Problem is here: You have changed something in 1.5.1. I'm wonder why? In case that in 1.5.0 this mechanism was fine (at least in my app). |
@adybionka Do you have a proof? Cause I'm sure we have tests for most cases of nested scope hierachies: https://github.com/angular-ui/ui-scroll/blob/master/test/AssigningSpec.js. Regarding to mechanism changing, I found some discussion #110... but the main question is still here: we can't use .scope method in so-called production mode activated via compileProvider.debugInfoEnabled(false) |
Ok, the problem is slightly different. I have app like this:
HTML of component A:
HTML of component B:
and adapter is properly assigned to Maybe this problem appears when in one ui-scroll is second which has also ui-scroll like in my app? Anyway this is not important since you need to rewrite this mechanism because of compileProvider.debugInfoEnabled. I analyzed a little your code, and I see that you don't create isolate scope for uiScrollViewport and uiScroll directive. So it is not possible to simply extract any variable by directive attribute by its scope. I have an idea how to easily change extracting adapter and rest of variables.
usage:
So you will have a very easy and reliable mechanism to extract variables by a directive isolate scope. Of course it is not backward compatible, but you can add this 2nd way of extracting variables, mark old one as deprecated and in the future release delete the old one. |
I have spent a lot of time to find out, why adapter is not assigned properly to controller scope but instead of it to rootScope.
In my html code I use uiScrollViewport directive, but still adapter was assigned to rootScope.
I analyzed ui-scroll code, and I found that scope is create from directive element:
var candidateScope = candidate.scope();
but my app has set
compileProvider.debugInfoEnabled(false)
socandidate.scope()
returns undefined. This is why adapter has been assigned to rootScope instead to my controller scope.In my opinion this is bug. ui-scroll should not be dependent of debugInfoEnabled flag. Especially you don't mention about it in the documentation and it is very hard to figure out what is wrong.
The text was updated successfully, but these errors were encountered: