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

前端 未结 3 1228
天涯浪人
天涯浪人 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:12

    To pass a variable in Angular 7 you can use it just like:

    [attr.data-target] = "theme.themeId"
    

提交回复
热议问题