title: How to clear input fields when materialize modal is closed?
body: <p>I am using materialize modal which has 3 input fields. I have kept modal dismissible true so that modal can be closed by clicking outside. When modal is closed by clicking on the close button then I am calling a function to clear the input fields however I am unable to do so when modal is closed by clicking outside.</p>
  
  <p>I have already tried using modal close callback option.</p>
  
  <pre><code>&lt;div id="resetpassword" class="modal modal-fixed-footer modal-index" ng-controller="ChangePassword"&gt;
       &lt;form&gt;
       &lt;div class="modal-header"&gt;
            &lt;span&gt;Change Password&lt;/span&gt;
            &lt;a class="btn-flat modal-action modal-close"&gt;
            &lt;i class="material-icons" ng-click="reset()"&gt;clear&lt;/i&gt;&lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="modal-content"&gt;
             &lt;div class="row"&gt;
                  &lt;div class="col s8 offset-s2"&gt;
                       &lt;div class="col s12"&gt;
                            &lt;div class="input-field col s12 clear"&gt;
                                 &lt;input name="old_password" ng-model="passForm.current_password" id="old_password" type="password"&gt;
                                  &lt;label class="left-align" for="old_password"&gt;Current Password&lt;/label&gt;
                            &lt;/div&gt;
                            &lt;div class="input-field col s12 clear"&gt;
                                  &lt;input name="new_password1" ng-model="passForm.password1" id="new_password" type="password"&gt;
                                  &lt;label class="left-align" for="new_password"&gt;New Password&lt;/label&gt;
                            &lt;/div&gt;
                            &lt;div class="input-field col s12 clear"&gt;
                                   &lt;input name="new_password2" ng-model="passForm.password2" id="cnf_new_password" type="password"&gt;
                                   &lt;label class="left-align" for="cnf_new_password"&gt;Confirm New Password&lt;/label&gt;
                            &lt;/div&gt;
                         &lt;/div&gt;
                    &lt;/div&gt;
               &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
               &lt;button class="btn" type="submit" ng-click="requestChangePassword()"&gt;Change Password&lt;/button&gt;
          &lt;/div&gt;
          &lt;/form&gt;
   &lt;/div&gt;
  
   &lt;script type="text/javascript"&gt;
        $(document).ready(function() {
             $('.modal').modal({complete: function(modal, trigger) {
                  reset();
             }});
         });
    &lt;/script&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>$scope.reset = function() {
        $scope.passForm.current_password = null;
        $scope.passForm.password1 = null;
        $scope.passForm.password2 = null;
  }
  </code></pre>
  
  <p>The above code gives error as reset() is not defined.</p>