title: AngularJs: I want to destroy the content in Modal Popup on Button Click
body: <p>I want to destroy the content in a modal pop up on button click so that on opening the pop up again, no content is found. So I have this</p>
  
  <pre><code>//clear the content of the text field
     $scope.cancel = function () {
      $modalInstance.dismiss('cancel');
    };
  </code></pre>
  
  <p>This is the button that calls the function</p>
  
  <pre><code>&lt;button style="border: 3px solid red; border-radius:5px; color: #ff6000" class="button button-clear button-positive" ng-click="cancel()"&gt;Clear&lt;/button&gt;
  </code></pre>
  
  <p>This is the content in the modal pop up</p>
  
  <pre><code>&lt;label class="item item-input"&gt;
                &lt;textarea ng-model="content" rows="5" placeholder="What's new..."&gt;&lt;/textarea&gt;
            &lt;/label&gt;
  &lt;img id="myImage" ng-show="imgURI !== undefined" ng-src="{{imgURI}}" class="imgBorder full-image"&gt;
  </code></pre>
  
  <p>When I click on the button, nothing happens. Please what is the cuase.</p>
  
  <p>EDITED:
  This is the code block that opens the modal</p>
  
  <pre><code>// Open our new task modal
    $scope.newPost = function(index) {
        var modalInstance = $modal.open({...});
         if (index == 1) $scope.postModal.show()
        else $scope.selectModal.show();
       // $scope.postModal.show();
  
    };
  </code></pre>