title: Bootstrap Modal validation displaying on dismiss
body: <p>I have a form view in AngularJS and I'm using a modal from Angular-ui to display my form. Functionality wise, everything works great, however, when I dismiss the form, validation pop-ups display if the form is invalid.</p>
  
  <p>This is what it looks like: </p>
  
  <p><img src="https://i.stack.imgur.com/paqKd.png" alt="enter image description here"></p>
  
  <p>The pop-up doesn't show at all when the form is open but only when I click cancel and it starts fading away. </p>
  
  <p>HMTL:</p>
  
  <pre><code>&lt;form name='newGroupForm'&gt;
      &lt;div class="modal-body"&gt;
              &lt;label for="groupName"&gt;Group Name:
                  &lt;input id="groupName" type="text" ng-model='newGroup.name' required&gt;
              &lt;/label&gt;
              &lt;br/&gt;
              &lt;label for="groupDesc"&gt;Group Description:
                  &lt;input id="groupDesc" type="text" ng-model='newGroup.desc'&gt;
              &lt;/label&gt;
              &lt;br/&gt;
              &lt;label for="groupOwner"&gt;Group Name:
                  &lt;select id="groupOwner" type="text"  &gt;&lt;/select&gt;
              &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;button class="btn btn-warning" ng-click="cancel()"&gt;Cancel&lt;/button&gt;
          &lt;button class="btn btn-primary" type="button" ng-click="submit()" ng-disabled="newGroupForm.$invalid"&gt;Create&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Modal Controller: </p>
  
  <pre><code>spApp.controller('newGroupCtrl', 
      function newGroupCtrl($scope, $modalInstance, groupService){
          $scope.newGroup = {
              name:null,
              desc: null
          };
  
          $scope.submit = function(){
              $modalInstance.close($scope.newGroup);
          }
          $scope.cancel = function (){
              $modalInstance.dismiss('Cancelled group creation');
          };
      }
  );
  </code></pre>