The DOM operation in the link can be a mouse stroke or a more complicated effect. For simplicity, I try to use ng-click and write a function in the scope to call it
The poster’s answer is that for click events at any time, only ng-click is used. There is no usage scenario that needs to be written in the link in the instruction.
It’s also not clear what exactly the poster is asking about. The only click thing in Angular is ngClick. In many cases, it is wrong to use the traditional addEventListener in the link function. You should also use ngClick in the template of the instruction.
In fact, traditional DOM operations are only required for events that do not require drag and drop
With ng-click, you can set a variable and use the value of the variable to control the area you want to show or hide through ng-show.
For example:
The DOM operation in the link can be a mouse stroke or a more complicated effect. For simplicity, I try to use ng-click and write a function in the scope to call it
The poster’s answer is that for click events at any time, only ng-click is used. There is no usage scenario that needs to be written in the link in the instruction.
It’s also not clear what exactly the poster is asking about. The only click thing in Angular is ngClick. In many cases, it is wrong to use the traditional addEventListener in the link function. You should also use ngClick in the template of the instruction.
In fact, traditional DOM operations are only required for events that do not require drag and drop