trigger click event from angularjs directive

后端 未结 4 2047
清歌不尽
清歌不尽 2021-02-02 10:05

How can i trigger a click event for li elements specifying their index from the angularjs directive? I have tried using $first for triggering click for the first element, but it

4条回答
  •  太阳男子
    2021-02-02 10:19

    This is an extension to Langdon's answer with a directive approach to the problem. If you're going to have multiple galleries on the page this may be one way to go about it without much fuss.

    Usage:

    
    
    

    See it working here

提交回复
热议问题