title: form validations using a directive not working
body: <p>i am new to angularJs.... i am trying to write a directive which wraps the input box inside a form tag and followed by a 'div' which includes validation. validation is not working. 
  plunker link : <a href="http://plnkr.co/edit/70vb9dicoSYITB0Uv4ZX?p=preview" rel="nofollow">PLUNKER</a> </p>
  
  <p>i am wrapping the input tag using the following code</p>
  
  <pre><code>var getHtml = function(){
                  return '&lt;div data-ng-show="myform.myfield.$error.required &amp;&amp;myform.myfield.$dirty "&gt;field is required&lt;/div&gt;';
                }
  
      element.attr('name','myfield');
      element.wrap('&lt;form name="myform"&gt;&lt;/form&gt;');
      element.after(getHtml());
  </code></pre>