How to insert "Dynamic Content" in uib-accordion developed with ng-repeat?

537 views Asked by At

I have created an uib-accordion in my angular project, where all the uib-accordion-group elements have been created under ng-repeat(for efficiency ofcourse).

<uib-accordion close-others="oneAtATime">
    <ul ng-model="some_code">
        <li ng-repeat="some_code">
            <div uib-accordion-group heading="{{some_code}}">
                {{some_code}}
            </div>
        </li>
   </ul>
</uib-accordion>

The problem is I want to insert different and dynamic content in the uib-accordion-group(s) but being in ng-repeat I can't use template-url. I have almost 6 rows to be displayed. Should I fall back to developing each accordion row individually(which would increase code size, hence I don't want) or do we have any such provision in uib-accordion (which maybe I am currently not aware of)?

Suggestions please.

2

There are 2 answers

3
sonu singhal On

The html code you want to put in each accordion. Are you getting it dynamically or you have the code you just want to put different code on different condition.

1
asder On

try to use ng-class and change the styles dynamically