title: Call parent function when click submit inside modal which is the component angularjs
body: <p>I have a modal which is a component.
  When I fill form in this modal and click submit I would like to invoke function in parent. </p>
  
  <p>parent controller.js</p>
  
  <pre><code>    .module('app.test')
      .controller('TestController', function ($uibModal) {
          let vm = this
          vm.addTest = addTest
          vm.openAddTestModal = openAddTestModal
  
  
          function openAddTestModal() {
              $uibModal.open({
                component: 'AddTestModalComponent',
                windowClass: 'test-modal',
              })
            }
  
          function addTest(test) {
            //do something
          }
      })
  </code></pre>
  
  <p>modal.component.js</p>
  
  <pre><code>  templateUrl: 'app/modals/add-test-modal.html',
    controllerAs: 'vm',
    controller: function () {
      this.testToSave = ['']
    }
  })
  </code></pre>
  
  <p>modal.component.html</p>
  
  <pre><code>&lt;div class="modal-header"&gt;
    &lt;h2 class="modal-title"&gt;Add test&lt;/h2&gt;
  &lt;/div&gt;
  &lt;div class="modal-body"&gt;
    &lt;div&gt;
      &lt;form&gt;
        &lt;label class="control-label"&gt;Test&lt;/label&gt;
        &lt;input class="form-control" name="" type="text" required="true" ng-model=""/&gt;
      &lt;/div&gt;
      &lt;div class="add-new"&gt;&lt;a href="" ng-click=""&gt;+ Add test&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="mt-4 d-flex justify-content-end"&gt;
      &lt;button class="btn btn-primary btn-blue" type="submit" ng-click="vm.addTest(vm.test)"&gt;Save&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So if I click <code>Save</code> I would like to invoke function <code>addTest()</code> which is inside parent controller. 
  How can I do this?</p>