title: angular form in a dialog
body: <p>I've a form in a $mdDialog called in a angularjs controller, like this:</p>
  
  <p>actions-controller.js</p>
  
  <pre><code>  function callForm() {
        $mdDialog.show({
            parent: angular.element(document.body),
            templateUrl: 'template.html',
            scope: $scope,
            controller: 'actionsController'
        }); 
    }
  
   function saveAction(action, isValid) {
  
              //code
  
          actionsRepository.saveAction(action)
          .then(function (data) {
  
              //other code
  
              //Close form, do nothing
              $scope.closeActionForm();
  
             //close dialog, not work
             $scope.close;
  
          },
          function (error) {
              sharedRepository.handleError(error);
  
          });
      }
  }
  
   $scope.close = function () {
      $mdDialog.hide();
  };
  </code></pre>
  
  <p>template.html</p>
  
  <pre><code>    &lt;form name="actionForm" ng-submit="saveAction( crm_act_action_temp,actionForm.$valid)" novalidate&gt;
      &lt;div layout="row" layout-align="end center"&gt;
          &lt;md-button type="submit" class="md-primary"&gt;save&lt;/md-button&gt;
  
          &lt;md-button type="button" class="md-primary" ng-click="close()"&gt;cancel&lt;/md-button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My problem is tha the dialog with the form works (open and use the scope) but doesn't close when it ends. Neither is close if I push cancel button, he say me that the colse function is undefined.</p>
  
  <p>Apparently, the $mdDialog remain open and I can´t do nothing more.</p>
  
  <p>Please help.</p>
  
  <p>P.D. I hope explained clearly. Sorry for my bad english.</p>