title: ng-show does not work if referenced property is created by directive
body: <p>I have an form with an text input and a validation message that has to be shown if the input changes. (This example make no sence but it is reduced to the base problem)
  What I want to generate in my angularJS directive is:</p>
  
  <pre><code>&lt;p&gt;Username:&lt;br&gt; 
    &lt;input type="text" name="user" ng-model="user" required&gt; 
    &lt;span style="color:red" ng-show="myForm.user.$dirty"&gt; Username is dirty.&lt;/span&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>See the example here. (The static passwd code works, the generated user code not)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var app = angular.module('myApp', []);
  app.controller('myCrtl', function($scope) {
      $scope.user = 'MyName';
      $scope.passwd = 'MyPw';
  })
  .directive("mytest", function($compile){
          return{
        scope: true,
              link: function(scope, element){
                  var template = '&lt;input type="text" name="user" ng-model="user" required&gt;'+
  '&lt;span style="color:red" ng-show="myForm.user.$dirty"&gt;'+
  'Username is dirty.&lt;/span&gt;';
                  var tmpFn= $compile(template);
                  var content = tmpFn(scope);
                  element.append(content);
              }
          }
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.js"&gt;&lt;/script&gt;  
  &lt;body&gt;
  
  &lt;h2&gt;Validation&lt;/h2&gt;
  
  &lt;form ng-app="myApp" ng-controller="myCrtl" 
  name="myForm" novalidate&gt;
  
  &lt;!-- the generated code does not work --&gt;
  &lt;p mytest&gt;User:&lt;br&gt;
  &lt;/p&gt;
  
  &lt;!-- the static code works--&gt;
  &lt;p&gt;Password:&lt;br&gt;
  &lt;input type="text" name="passwd" ng-model="passwd" required&gt;
  &lt;span style="color:red" ng-show="myForm.passwd.$dirty"&gt;
  Password is dirty.&lt;/span&gt;
  &lt;/p&gt;  
  &lt;/form&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem seems, that myForm.user is created in the directive</p>