{"action":"created","issue":{"url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/490","repository_url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps","labels_url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/490/comments","events_url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/490/events","html_url":"https://github.com/allenhwkim/angularjs-google-maps/issues/490","id":128272080,"number":490,"title":"weird NgMapPool behavior if ngAnimate and ui-router are app dependencies","user":{"login":"flc","id":250136,"avatar_url":"https://avatars.githubusercontent.com/u/250136?v=3","gravatar_id":"","url":"https://api.github.com/users/flc","html_url":"https://github.com/flc","followers_url":"https://api.github.com/users/flc/followers","following_url":"https://api.github.com/users/flc/following{/other_user}","gists_url":"https://api.github.com/users/flc/gists{/gist_id}","starred_url":"https://api.github.com/users/flc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flc/subscriptions","organizations_url":"https://api.github.com/users/flc/orgs","repos_url":"https://api.github.com/users/flc/repos","events_url":"https://api.github.com/users/flc/events{/privacy}","received_events_url":"https://api.github.com/users/flc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-22T23:43:34Z","updated_at":"2016-04-03T23:11:19Z","closed_at":"2016-04-03T23:11:18Z","body":"http://plnkr.co/edit/eWE8lM0UteXZZhYrCk7Z?p=preview\r\nClick the Map X links and as you can see there are multiple instances for the same map in NgMapPool's mapInstances. While in this example it doesn't really cause any harm, in my complex application it causes really weird things which I'm not able to demonstrate here.\r\n\r\nNow the weird thing is that if you remove ngAnimate from the app dependencies the problem is gone.\r\n```\r\nvar myapp = angular.module('myapp', ['ngAnimate', 'ngMap','ui.router']);\r\n```\r\n->\r\n```\r\nvar myapp = angular.module('myapp', ['ngMap','ui.router']);\r\n```\r\nIt took me hours to debug this and figure out that the ngAnimate dependency is the root of the problem. I've tried to use the 1.0.0alpha0 version of ui-router but I get the same result with it.\r\nWhat I found is that if I remove this particular if statement from ui-router's viewDirective then the problem is gone:\r\nhttps://github.com/angular-ui/ui-router/blob/db79d76e5abdb71bbf4baf8d9c3c08ba5ea08d20/src/viewDirective.js#L143\r\nI guess it's because with ngAnimate active the 'enter' and 'leave' are promises.\r\n"},"comment":{"url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/comments/205074351","html_url":"https://github.com/allenhwkim/angularjs-google-maps/issues/490#issuecomment-205074351","issue_url":"https://api.github.com/repos/allenhwkim/angularjs-google-maps/issues/490","id":205074351,"user":{"login":"allenhwkim","id":1437734,"avatar_url":"https://avatars.githubusercontent.com/u/1437734?v=3","gravatar_id":"","url":"https://api.github.com/users/allenhwkim","html_url":"https://github.com/allenhwkim","followers_url":"https://api.github.com/users/allenhwkim/followers","following_url":"https://api.github.com/users/allenhwkim/following{/other_user}","gists_url":"https://api.github.com/users/allenhwkim/gists{/gist_id}","starred_url":"https://api.github.com/users/allenhwkim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenhwkim/subscriptions","organizations_url":"https://api.github.com/users/allenhwkim/orgs","repos_url":"https://api.github.com/users/allenhwkim/repos","events_url":"https://api.github.com/users/allenhwkim/events{/privacy}","received_events_url":"https://api.github.com/users/allenhwkim/received_events","type":"User","site_admin":false},"created_at":"2016-04-03T23:11:18Z","updated_at":"2016-04-03T23:11:18Z","body":"Closing this inactivity and out of scope. Please reopen a new issue if problem is consistent."}}