title: How do I call a function defined inside controller.js from a modal popup
body: <p>Here is my modal popup I have used in my controller.js . I just want to call a function send() defined in same controller on button click. But the ng-click is not working in modalpopup.</p>
  
  <pre><code>$scope.sendMessage = function(order_id) { 
          var modalInstance = $uibModal.open({
              template: '&lt;div id="order-flow-modal" class="inmodal"&gt;' +
                      '&lt;div class="modal-header"&gt;' +
                      '&lt;h4 class="modal-title"&gt;Order Description&lt;/h4&gt;' +
                      '&lt;small class="font-bold"&gt;&lt;/div&gt;' +
                      '&lt;div class="modal-body"&gt;&lt;textarea name="message" ng-model="formData.message"  style="width:100%;"&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;input type="text" ng-model="formData.order_id" value="'+order_id+'"&gt;&lt;/div&gt;' +
                      '&lt;div class="modal-footer"&gt;' +
                      '&lt;a class="btn btn-success" ng-click="send()"&gt;Send&lt;/a&gt;' +
                      '&lt;button type="button" class="btn btn-white" ng-click="cancel()"&gt;Close&lt;/button&gt;' +
                      '&lt;/div&gt;' +
                      '&lt;/div&gt;',
              windowClass: "animated flipInY",
              controller: ModalInstanceCtrl,
              backdrop: true
          });
          modalInstance.opened.then(function() {
  
          });
          modalInstance.result.then(function() {
  
          }, function() {
  
          });
          return false;
      };
  </code></pre>
  
  <p>And below is my send().</p>
  
  <pre><code>$scope.send = function() { 
          alert('hi');
          return false;
      };
  </code></pre>