6
<ul> 
     <li data-info="Amount in (₹)">{{depositeAmt}}</li>
     <li data-info="Status">
        <button class="statusbtn Process"  data-bs-toggle="collapse" data-bs-target="#collapseExample1" >{{status}}</button>
     </li>
</ul>
<div class="newClass collapse" id="collapseExample1{{i}}">

where i is defined in ts file as i:number=1;

dan1st
  • 12,568
  • 8
  • 34
  • 67

2 Answers2

9

To add an attribute using an expresion or variable you can use

[attr.name-of-attribute]="expresion"

e.g.

[attr.data-bs-target]="'#collapseExample'+i" 

But I don't know if you can use with bootstrap to create a collapse

Eliseo
  • 50,109
  • 4
  • 29
  • 67
  • Hi Eliseo @eliseo , can you please look into this question if possible - https://stackoverflow.com/questions/69475845/is-there-any-way-to-retain-the-state-of-multiple-expandable-mat-grid-after-refre ? TIA . – angular_code Oct 07 '21 at 06:46
0

I think this is very similar to the answer provided in this case:

Please, see it and let me know if it is working for you.

Yuriy
  • 53
  • 7
  • 1
    It would be better to either expand your answer so it works without the link, or consider marking the question as duplicate. Thanks! – tobiv Sep 13 '22 at 15:41