title: how to test DOM events returned by document.getElementById in angular using jasmine
body: <p>I have below code in my controller.</p>
  
  <pre><code>        var myLink = document.getElementById('myId');
  
          myLink.onclick = function (event) {
              event.preventDefault();
              $state.transitionTo('mystate', { message:"hello" });
          }
  </code></pre>
  
  <p>when I create object for my controller in my test case it is giving the error: <strong>Cannot set property 'onclick' of null</strong></p>
  
  <p>Anyone know how to handle this?</p>