title: Angular UI bootstrap uibModalInstance.result not yielding any value
body: <p>Below is my code for the directive <code>cabinet</code> and my two controllers <code>CabinetThumbnails</code>,<code>ModalCtrl</code>. Based on my requirement i am using the directive <code>cabinet</code> and the <code>CabinetThumbnails</code> to render couple of widgets and then on click of every widget using <code>ModalCtrl</code> to open a popup. The Widgets are generating fine, pop-up is opening fine too but <code>(uibModalInstance.result.then(function (thumbnailData))</code> is not working. So , its not hitting the service too <code>cabinetService.getComments(thumbnailData)</code>. What's wrong here ?couldn't figure out.</p>
  
  <pre><code>function () {
      'use strict';
  
      angular
          .module('myModule')
          .directive('cabinet', function () {
              return {
                  restrict: 'E',
                  replace: true,
                  controller: CabinetThumbnails,
                  controllerAs: 'ctrl',
                  bindToController: true,
                  link: link,
                  templateUrl: 'app/cabinet/cabinet.directive.html',
                  scope: {
                      thumbnail: '='
                  }
              };
          });
      function link(scope, el, attrs) {
      }
  
      CabinetThumbnails.$inject = ['$scope','$uibModal','cabinetService'];
  
      function CabinetThumbnails($scope,$uibModal,cabinetService) {
          var vm = this;
  
          vm.showImage = showImage;
  
          activate();
  
          function activate() {
          }
  
          function showImage() {
              var uibModalInstance = $uibModal.open({
                  animation: true,
                  templateUrl: 'app/components/capture/cabinet.pop-up.html',
                  controller: ModalCtrl,
                  controllerAs: 'ctrl',
                  size: 'lg',
                  resolve: {
                      thumbnailData: function () {
                          return vm.thumbnail;
                      }
                  }
              });
  
              uibModalInstance.result.then(function (thumbnailData) {
                  spinner.spinnerShow();
  
                  //call the service to get the comments
                  cabinetService
                      .getComments(thumbnailData)
                      .then(function (data) {
                        $scope.comments = data;
                      })
                      .catch(function (err) {
                          growl.err('Unable to open the screen shot, Please try later !', {ttl: 20000});
                      })
                      .finally(spinner.spinnerHide);
              }, function () {
                  $log.info('Modal dismissed at: ' + new Date());
              });
          }
      }
  
      ModalCtrl.$inject = ['$scope', '$uibModalInstance', 'thumbnailData', 'growl'];
  
      function ModalCtrl($scope, $uibModalInstance, thumbnailData, growl) {
          var ctrl = this;
  
          ctrl.thumbnailData = thumbnailData;
          ctrl.cancel = cancel;
  
          function cancel() {
              $uibModalInstance.dismiss();
          }
      }
  }());
  </code></pre>