LukaszWatroba / v-accordion

Multi-level accordion component for AngularJS.
http://lukaszwatroba.github.io/v-accordion
MIT License
310 stars 100 forks source link

toggle method can not be overwritten #78

Open jeevasusej opened 7 years ago

jeevasusej commented 7 years ago

I am getting the following issue in the browser console.

Error: Thetogglemethod can not be overwritten

Which scenario, this issue will occur. How to avoid?

jeevasusej commented 7 years ago

Found the issue.

Can you solve the following scenario?

I have initiated the v accordion first.

Then I navigate to other control.

Based on the if condition, the directive hides. So again if i enable the directive, then the object which is defined by the directive is available and not yet vanished.

So this issue has been raised. Now I have assigned the null object based on condition.

Please solve the issue.

HalidCisse commented 7 years ago

having the same issue, any workaround ?

OogieBoogieInJSON commented 7 years ago

I think this repository is not maintained anymore. The problem is with scope.control, it is bidirectionally bound and unless you are clearing it from parent controller/directive anything won't work without some refactoring (not even clearing on $destroy). So, when you are hiding the accordion inside a ng-if, make sure you set your control reference to undefined when the ng-if check will resolve to false.