How to prevent an angular-bootstrap dropdown from closing (Unbind Event which was bound by a directive)

后端 未结 9 1598
你的背包
你的背包 2020-12-28 12:52

I am using the Angular-Bootstrap Dropdown. I want to prevent it from closing on click until the user closes it intentionally.

Default state is: The Dropdown closes

9条回答
  •  时光取名叫无心
    2020-12-28 12:56

    This is a crude way of overriding it. You need to control the is-open attribute manually and hijack the on-toggle event, example:

    
    

    Controller:

        $scope.toggled = function (open) {
            $timeout(function () {
                $scope.ctrl.isOpen = true;
            });
        };
    

    I would ask for a property on the dropdownConfig constant (something like autoClose) for a permanent solution.

提交回复
热议问题