Anonymous - 2015-09-07

Originally posted by: IvanDimanov

Hi @cuda-pdong
I think you should try

app.controller('SampleController', function SampleController($scope, ModalService) {
  $scope.showAModal = function () {
    ModalService.showModal({
      templateUrl: 'yesno/yesno.html',
      controller : 'YesNoController'
    }).then(function showModalThen(modal) {

      function customClose(result) {
        $scope.message = result ? 'You said Yes' : 'You said No'
      }

      modal.element.modal()

      modal.element.one('hidden.bs.modal', function manualDestroy() {
        modal.scope.$destroy()
        modal.element.remove()
        customClose()
      })

      modal.close.then( customClose )
    })
  }
})

That's the only way I found possible