angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.27k stars 6.73k forks source link

isOpen doesn't work properly #6322

Closed xskif closed 7 years ago

xskif commented 7 years ago

Bug description:

I can't manually assign isOpen for dropdown, the same issue with tooltips and popovers. It seems it has been broken after major release (1.x -> 2.x) because before that everything had worked fine.

I have this code in my directive

$scope.isOpen = false;

            function onSelectorToggle(open) {
                console.warn(open, $scope.isOpen);
            }

and this one in my .slim file

div uib-dropdown="" auto-close="outsideClick" is-open="isOpen" on-toggle="onSelectorToggle(open)"

Each toggle action fires in the console (true|false) for the 'open' attribute and false always for the '$scope.isOpen'

Angular: 1.5.6

UIBS: 2.2.1

Bootstrap: none

xskif commented 7 years ago

Looks like it's 'dot issue'

jlf123 commented 7 years ago

dot issue??

xskif commented 7 years ago

Yes. Use $ctrl.isOpen or vm.isOpen, never use $scope directly