Angular绑带警报启动功能不发射



我们一直在使用Angular-Strap警报服务来进行警报,现在需要通过在警报打开后通过关注警报消息来使其访问。

我尝试在警报选项中添加OnShow函数,但是OnShow功能没有启动。

我该如何工作?这是选项配置

Itinerary.alertConflict = function () {
    if ($rootScope.conflictShown) return false;
    $rootScope.conflictShown = true;
    $rootScope.conflictAlert = $rootScope.showAlert({
        template: '/Content/views/alerts/exhibition-conflict.html',
        animation: 'am-fade-and-slide-top',
        placement: 'top',
        type: 'warn',
        show: true,
        onShow: function () {
            alert('TEST');
            $timeout(function() {
                var message = document.getElementById('alert');
                if (message  !== null) {
                    message .focus();
                }
            });
        }
    });
}

在您的HTML元素女巫上添加bs-on-show="yourFunction"属性具有bs-alert指令。 yourFunction应该在范围内。

这是可能的

最新更新