code-tofu / project_Pokemart

0 stars 0 forks source link

Modal for Quick Buy loads the same modal regardless of triggering element/catalogue item #1

Closed code-tofu closed 1 year ago

code-tofu commented 1 year ago

Modal loads data only from first element in NgFor. Suggest to use ngcontent and push the info to catalogue main

code-tofu commented 1 year ago

Modal target was the same for each ngfor element. All buttons called the first modal element:

data-bs-target="#staticBackdrop"
id="staticBackdrop" 

Solved using attribute binding:

[attr.id]="'backdrop' + item.productID"
[attr.data-bs-target]="'#backdrop' + item.productID"