title: angularJS - getting x & y positions from mouseclick in div
body: <p>I made a function that should add an item on the position I clicked inside a div. Now the problem with this function is, every time I click, it takes the x &amp; y position of the document, not the x &amp; y position inside the div. So what I actually want, is that the top-left corner of my div should give x=0 &amp; y=0, but I don't know if this is possible? And I guess there is another way to do this..</p>
  
  <pre><code>$scope.addOnClick = function(event) {
          $scope.items.push( {
              "label": "Click",
              "value": 100,
              "x": event.x-50,
              "y": event.y-50,
          })
  }
  </code></pre>