title: get element by Id and addClass in angularjs
body: <p>m trying to get a element by its Id in angularJs and then add a class to it. I have used "<em>ng-attr-id</em>" to assign id to my element and now m not able to addClass to it. </p>
  
  <p>html:</p>
  
  <pre><code>&lt;div ng-attr-id= {{id}} &gt;Text&lt;/div&gt;
  &lt;button ng-click="action"&gt;action&lt;/button&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>  $scope.id="name";
  
    $scope.action=function(){
    angular.element($document[0].getElementById("name")).addClass("align");
    }
  </code></pre>
  
  <p>the plunkr : <a href="http://plnkr.co/edit/VjORCl5xoHQZbzBG6HDp?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/VjORCl5xoHQZbzBG6HDp?p=preview</a> </p>
  
  <p>PS :Any solution other than using ng-class will be more appreciated. I dont need that based on my current problem</p>