How to pass variable to “data-target=” angular 2

前端 未结 3 1161
天涯浪人
天涯浪人 2021-02-01 01:34

I\'m working with angular 2 typescript and i want to create a toggle collapse list. This is simple with single id and data-target but i loop throught a list so i ha

3条回答
  •  深忆病人
    2021-02-01 02:27

    You could used attribute binding. Something like that:

    [attr.data-target]="'#' + theme.themeId"
    

提交回复
热议问题