hi Neil
You might need to be a bit more specific about what you are trying to achieve.
In general, AngularJS helps you to avoid adding any listeners to your code directly e.g. instead of adding an on-click event listener directly, you would use an ng-click attribute on the element....
// add event listener to t
var el = document.getElementById("someelement");
el.addEventListener("click", someFunction, false);
<div ng-click="someFunction()">
If you are writing directives and you are familiar with JQuery, you can add listeners on elements in the link function using a JQuery syntax...
- return function(scope, element, attr) {
- var startX = 0, startY = 0, x = 0, y = 0;
-
- element.on('mousedown', function(event) {
- // Prevent default dragging of selected content
- event.preventDefault();
- startX = event.pageX - x;
- startY = event.pageY - y;
- $document.on('mousemove', mousemove);
- $document.on('mouseup', mouseup);
- });
HTH
Michael