{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3432","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3432/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3432/comments","events_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3432/events","html_url":"https://github.com/angular-ui/bootstrap/issues/3432","id":64069893,"number":3432,"title":"Attempt to get multiple datepickers closing properly...","user":{"login":"cleon26","id":7850944,"avatar_url":"https://avatars.githubusercontent.com/u/7850944?v=3","gravatar_id":"","url":"https://api.github.com/users/cleon26","html_url":"https://github.com/cleon26","followers_url":"https://api.github.com/users/cleon26/followers","following_url":"https://api.github.com/users/cleon26/following{/other_user}","gists_url":"https://api.github.com/users/cleon26/gists{/gist_id}","starred_url":"https://api.github.com/users/cleon26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleon26/subscriptions","organizations_url":"https://api.github.com/users/cleon26/orgs","repos_url":"https://api.github.com/users/cleon26/repos","events_url":"https://api.github.com/users/cleon26/events{/privacy}","received_events_url":"https://api.github.com/users/cleon26/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/component:%20datepicker","name":"component: datepicker","color":"ffffff"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/PRs%20plz!","name":"PRs plz!","color":"02d7e1"},{"url":"https://api.github.com/repos/angular-ui/bootstrap/labels/type:%20enhancement","name":"type: enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular-ui/bootstrap/milestones/14","html_url":"https://github.com/angular-ui/bootstrap/milestones/Backlog","labels_url":"https://api.github.com/repos/angular-ui/bootstrap/milestones/14/labels","id":806073,"number":14,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.","creator":{"login":"chrisirhc","id":132584,"avatar_url":"https://avatars.githubusercontent.com/u/132584?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisirhc","html_url":"https://github.com/chrisirhc","followers_url":"https://api.github.com/users/chrisirhc/followers","following_url":"https://api.github.com/users/chrisirhc/following{/other_user}","gists_url":"https://api.github.com/users/chrisirhc/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisirhc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisirhc/subscriptions","organizations_url":"https://api.github.com/users/chrisirhc/orgs","repos_url":"https://api.github.com/users/chrisirhc/repos","events_url":"https://api.github.com/users/chrisirhc/events{/privacy}","received_events_url":"https://api.github.com/users/chrisirhc/received_events","type":"User","site_admin":false},"open_issues":117,"closed_issues":12,"state":"open","created_at":"2014-09-29T01:22:44Z","updated_at":"2015-04-30T14:57:58Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-03-24T18:42:03Z","updated_at":"2015-05-01T14:59:52Z","closed_at":null,"body":"To start...  I'm trying to put the date picker popup into a directive that I reuse across my app.\r\n\r\nhttp://plnkr.co/edit/Qj7eUGzVCSNNxvX2cQd0?p=preview\r\n\r\nIf I load multiple datepicker popups on the same page, they can both be opened at the same time.  I would expect that one would close as the other is opened and I've found several issues here that say that should be the case.\r\n\r\nAfter googling around, I'm led to believe it's a scope issue.  Is this the case I'm running into?  And if so, what does \"you need a dot in your model\" mean in my case?\r\n\r\nhttps://github.com/angular-ui/bootstrap/pull/3382\r\nhttp://stackoverflow.com/questions/25307576/ng-include-changing-behavior-of-angular-ui-datepicker#25308180\r\n\r\nI also found this post which seems to exhibit the same problem:\r\nhttps://github.com/angular-ui/bootstrap/issues/3157\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular-ui/bootstrap/issues/comments/98149311","html_url":"https://github.com/angular-ui/bootstrap/issues/3432#issuecomment-98149311","issue_url":"https://api.github.com/repos/angular-ui/bootstrap/issues/3432","id":98149311,"user":{"login":"nonplus","id":1023803,"avatar_url":"https://avatars.githubusercontent.com/u/1023803?v=3","gravatar_id":"","url":"https://api.github.com/users/nonplus","html_url":"https://github.com/nonplus","followers_url":"https://api.github.com/users/nonplus/followers","following_url":"https://api.github.com/users/nonplus/following{/other_user}","gists_url":"https://api.github.com/users/nonplus/gists{/gist_id}","starred_url":"https://api.github.com/users/nonplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonplus/subscriptions","organizations_url":"https://api.github.com/users/nonplus/orgs","repos_url":"https://api.github.com/users/nonplus/repos","events_url":"https://api.github.com/users/nonplus/events{/privacy}","received_events_url":"https://api.github.com/users/nonplus/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T14:59:51Z","updated_at":"2015-05-01T14:59:51Z","body":"This is a documentation/example problem.  The current documentation suggests the following:\r\n```\r\n  $scope.open = function($event) {\r\n    $event.preventDefault();\r\n    $event.stopPropagation();\r\n\r\n    $scope.opened = true;\r\n  };\r\n```\r\nHowever, the `$event.preventDefault()` prevents other datepicker calendars from being automatically closed.  The proper implementation should be as follows:\r\n```\r\n  $scope.open = function($event) {\r\n    if($scope.opened) {\r\n      // Prevent datepicker from closing this calendar popup\r\n      $event.preventDefault();\r\n      $event.stopPropagation();\r\n    } else {\r\n      // Delay opening until next tick, otherwise calendar popup will be immediately closed\r\n      $timeout(function() {\r\n        $scope.opened = true;\r\n      }\r\n    }\r\n  };\r\n```"}}