title: decoupling $scope.form from controller
body: <p>In my angular controller, I have to reset some form fields to pristine at a certain point (when some other field changes). The code looks something like this ...</p>
  
  <pre><code>$scope.fieldCallback = function() {
    $scope.data.Field = undefined;
    $scope.form.field.$setPristine();
  }
  </code></pre>
  
  <p>this of course causes problem once I run my unit tests, because form.field will only be there if you actually parse the document (which of course in the case of unit tests is not happening). I know it is possible to do something along the lines of </p>
  
  <pre><code>var element = angular.element(...[some html]...);
  $compile(element)($scope);
  </code></pre>
  
  <p>but this does not really seem like a good solution to me.</p>
  
  <p>Is there any way to decouple the controller from the html so I don't have to mock this like described above?</p>
  
  <p>Thx in advance!</p>