Matteo Scandolo | 7cd88ba | 2015-12-16 14:23:08 -0800 | [diff] [blame] | 1 | angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope, $log) { |
| 2 | $scope.items = [ |
| 3 | 'The first choice!', |
| 4 | 'And another choice for you.', |
| 5 | 'but wait! A third!' |
| 6 | ]; |
| 7 | |
| 8 | $scope.status = { |
| 9 | isopen: false |
| 10 | }; |
| 11 | |
| 12 | $scope.toggled = function(open) { |
| 13 | $log.log('Dropdown is now: ', open); |
| 14 | }; |
| 15 | |
| 16 | $scope.toggleDropdown = function($event) { |
| 17 | $event.preventDefault(); |
| 18 | $event.stopPropagation(); |
| 19 | $scope.status.isopen = !$scope.status.isopen; |
| 20 | }; |
| 21 | }); |