Damir
Damir

Reputation: 56179

How to create id in element in template when I have passed parameter?

How to create id in element in template when I have passed parameter ? I have tried something like

<button id="p_"+{{key}} >TEST</button>

but in rendered HTML id is just p_ . Can someone tell me how to achieve this ?

Upvotes: 1

Views: 55

Answers (2)

mshsayem
mshsayem

Reputation: 18008

<button id="p_{{key}}">TEST</button>

Upvotes: 1

dm03514
dm03514

Reputation: 55932

<button id="p_{{key}}">TEST</button>

you need the key to be Inside the quotes

I'm assuming you were using + to concat strings. I don't believe html supports any operations like that.

Upvotes: 4

Related Questions