How to reset the form validations of angularjs after closing the bootstrap modal
<blockquote>
  <p>Here I applied angularjs form validations for a form which is in a bootstrap model.But what the issue is ,the error messages and the dat in text fields remain same even after closing the model`</p>
</blockquote>

<pre><code>&lt;div class="modal fade loginpopup index" id="login-modal"   tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" &gt;
         &lt;div class="modal-dialog login-form animated"&gt;
             &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                        &lt;button type="button" class="close" data-dismiss="modal"&gt;×&lt;/button&gt;
                 &lt;/div&gt;
                 &lt;div class="modal-body"&gt;
                      &lt;form  name="loginform"&gt;
                          &lt;div id="my-tab-content" class="tab-content"&gt;
                                &lt;div class="tab-pane active" id="login" name="login"&gt;
                                    &lt;div class="form-group" &gt;
                                         &lt;input type="email" id="userName" name="userName" class="form-control" ng-model="email" placeholder="UserName" required &gt;
                                         &lt;span class="has-error" ng-show="loginform.userName.$touched &amp;&amp; loginform.userName.$invalid" class="font-ten"&gt;
                                                &lt;span class="has-error"   ng-show="loginform.userName.$error.email" class="font-ten"&gt;Invalid  email address.&lt;/span&gt;
                                                &lt;span class="has-error" ng-show="loginform.userName.$error.required" class="font-ten"&gt;UserName is required..&lt;/span&gt;


                                            &lt;/span&gt;
                                    &lt;/div&gt;
                                    &lt;div class="form-group"&gt;
                                        &lt;input type="password" id="psd" name="psd" class="form-control" placeholder="Password"   required &gt;
                                    &lt;/div&gt;
                                    &lt;div class="form-group text-center" &gt;
                                            &lt;button class="btn btn3d text-center imm" type="submit" &gt; Log In     &lt;/button&gt;
                                    &lt;/div&gt;
                                    &lt;div class="form-group login-index" style="margin-bottom:0px;padding-top:0px !important"&gt;
                                            &lt;input type="checkbox" name="checkbox" id="Option"&gt;
                                            &lt;label class="Option" for="Option"&gt; Rememer Me &lt;/label&gt;
                                            &lt;a href="/#forgetpassword" data-toggle="tab"  id="forgotpsw"&gt;Forgot Password?&lt;/a&gt;
                                        &lt;/div&gt;
                                &lt;/div&gt;

                                &lt;div class="tab-pane" id="forgetpassword"&gt;
                                    &lt;div class="form-group " &gt;
                                        &lt;input type="email" id = "emailId" name="emailId" required class="form-control"  placeholder="Email Address" &gt;
                                    &lt;/div&gt;
                                    &lt;div class="form-actions text-center"&gt;
                                        &lt;button type="button" class="btn btn3d imm"  &gt;Submit &lt;/button&gt;
                                    &lt;/div&gt;


                             &lt;/div&gt;
                           &lt;/div&gt;
                      &lt;/form&gt;
                 &lt;/div&gt;
             &lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
</code></pre>