title: How to Get Html Element Attributes in AngularJS?
body: <p>Edit: Everyone went on all kinds of tangents, but the question remains - how do I get an attribute of an html element inside an angular controller? </p>
  
  <p>Here is a plnkr attempt: <a href="http://plnkr.co/edit/0VMeFAMEnc0XeQWJiLHm?p=preview" rel="nofollow">http://plnkr.co/edit/0VMeFAMEnc0XeQWJiLHm?p=preview</a></p>
  
  <pre><code>    //$scope.myElem = angular.element('testDiv'); //this breaks angular
      $scope.myElem = $document.find('testDiv'); //this doesn't break angular, but unclear what it returns
      $scope.myAttr = $scope.myElem.name; //this returns nothing
  </code></pre>
  
  <p>If you need convincing that this is actually necessary - I need to find when a user scrolls through a div, as is shown here: <a href="http://jsfiddle.net/rs3prkfm/" rel="nofollow">http://jsfiddle.net/rs3prkfm/</a> Note that this has nothing to do with the question, simply a scenario. The question is simple - how do I get an attribute's value?</p>
  
  <p>References:<br>
  Useless official docs: <a href="https://docs.angularjs.org/api/ng/function/angular.element" rel="nofollow">https://docs.angularjs.org/api/ng/function/angular.element</a><br>
  The only useful link that still doesn't work: <a href="http://mlen.io/angular-js/get-element-by-id.html" rel="nofollow">http://mlen.io/angular-js/get-element-by-id.html</a></p>