UI bootstrap modal

modal opens another modal created for this SO: http://stackoverflow.com/questions/34243879/trigger-modal-on-form-ngsubmit

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap-tpls.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
    <div ng-app="ui.bootstrap.demo">
      <div ng-controller="ModalDemoCtrl">
        <script type="text/ng-template" id="myModalContent.html">
          <div class="modal-header" ng-controller="ModalDemoSecondCtrl">
            <h3 class="modal-title">I'm a modal!</h3>
          </div>
          <div class="modal-body" ng-controller="ModalDemoThirdCtrl">
            Demo form submit:
            <br/>
            <form ng-submit="ok()">
              <div class="input-group animated fadeIn">
                <input type="text" class="form-control finderBar" ng-model="searchTerm" placeholder="City, State..." autofocus>
                <span class="input-group-btn">
                <button class="btn btn-default" type="button" ng-click="ok()">Go!</button>
            </span>
              </div>
            </form>
          </div>
          <div class="modal-footer">
            <button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
            <button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
          </div>
        </script>
        <button type="button" class="btn btn-default" ng-click="open()">Open me!</button>
      </div>
    </div>

JavaScript

angular.module('ui.bootstrap.demo', ['ui.bootstrap'])
      .controller('ModalDemoCtrl', function($rootScope, $scope, $log, $uibModal) {
      
        $scope.open = function(size, template) {
          var modalInstance = $uibModal.open({
              animation: $scope.animationsEnabled,
              templateUrl: template || 'myModalContent.html',
              controller: 'ModalInstanceCtrl',
              size: size
            });
        };

        $scope.toggleAnimation = function() {
          $scope.animationsEnabled = !$scope.animationsEnabled;
        };

      }).controller('ModalDemoSecondCtrl', function($rootScope, $scope, $log, $uibModal) {
      }).controller('ModalDemoThirdCtrl', function($rootScope, $scope, $log, $uibModal) {
      });

    angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function($scope, $uibModalInstance) {
      $scope.ok = function() {
        $uibModalInstance.dismiss('cancel');
      };

      $scope.cancel = function() {
        $uibModalInstance.dismiss('cancel');
      };
    });