Reputation: 1795
I am working on dynamically creating the tiles like UI for showing the metrics. i want to show some color dynamically based on the id. i need to append "_flag" with the dynamic value(symptom.symId = S1). my code is given below.
<div data-bind="foreach: {data:symptomArray , as: 'symptom'}">
<div data-bind="attr:{ id : symptom.symId}"> </div>
</div>
Please help me
Upvotes: 0
Views: 715
Reputation: 114792
If I understand your question correctly, then you want to do:
attr: { id: sympton.symId + '_flag' }
or if symId
is observable, then:
attr: { id: sympton.symId() + '_flag' }
Upvotes: 1