如何连接 AngularStrap 模态显示事件

How to wireup an AngularStrap modal show event

我的模式显示很好。我正在尝试弄清楚如何在显示模式时 运行 一个函数。

 var = loginModal = $modal({ placement: 'left', title: '', content: webauth, show: false });

 $scope.$on('modal.show', function () {
        console.log("SHOWN");
        debugger;
    });

    $scope.showModal = function () {

        loginModal.$promise
            .then(loginModal.show);

    };

我原以为 $scope.$on('modal.show') 会在显示模式时触发,但到目前为止运气不好。

试试这个:

$scope.showModal = function() {
    myModal.$promise.then(myModal.show).then(function(){
        console.info('shown');
    });
};