-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Accordion doesn't propagate is-open to parent scope #1034
Comments
@laz2 http://plnkr.co/ with a reproduce scenario, please... |
@laz2 is right! Actually there are cases (our demo page is one of them) that user's scope is 3 Will submit PR soon. |
@bekos I'm noticing that after this change I'm no longer able to set isOpen to a scoped variable in a parent controller of the accordion. Example: If I want to set your variable, "isopen" to true by default in my controller, $watch won't pick it up anymore. Thoughts? |
@bekos too funny. That's exactly what I ended up doing on my end. Thanks for the fast response :) |
Ran into this on the latest. I have a controller with variables such as isOpen1 isOpen2, etc. One for each accordionGroup. isopen1={{isopen1}}
... bunch of controls then Next Section doset is a method on my controller:
Changing the variables this way has no effect with the master code. Setting setIsOpen(scope.$parent, value); as suggested above makes the code work and the accordions close/open as expected for me... |
accordion.js, line 94
This code sets isOpen in parent scope, but for 'accordionGroup' directive parent scope is scope of 'accordion' directive. IMHO, just replace scope.$parent with scope.$parent.$parent
The text was updated successfully, but these errors were encountered: