1

I'm using scope.$first and scope.$index to apply accordion to my content when ng-repeat finishes populating it. At first I was using just scope.$last but faced this problem - when try to search for some info (using filter) and then turn back to the whole list, accordion doesn't apply.

How to apply accordion when ng-repeat finishes and save it further while filtering?

2
  • 1
    It would be much easier to answer if you could provide some code or even better, a working example using jsfiddle (or similar service). Commented Dec 5, 2012 at 8:25
  • I will post jsfiddle a bit later. Commented Dec 5, 2012 at 8:43

1 Answer 1

1

I suggest wrapping the "apply accordion" functionality into a directive. Define a template for the ng-repeat stuff, then $watch() the model data for changes. When the $watch triggers, apply the accordion stuff.

See also https://groups.google.com/d/topic/angular/lACrEA-TIto/discussion
and http://angular-ui.github.com/bootstrap/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.