Add class to an element in Angular 4

前端 未结 5 1970
北荒
北荒 2021-02-01 14:28

I was trying to create an image gallery with Angular 4.The logic behind this is to add a Cascading Style Sheet (CSS) class to the selected image that will show a red border on t

5条回答
  •  广开言路
    2021-02-01 14:57

    If you need that each div will have its own toggle and don't want clicks to affect other divs, do this:

    Here's what I did to solve this...

    ...content...
    ...content...
    ...content...

    it requires custom numbering which sucks, but it works.

提交回复
热议问题