{"action":"created","issue":{"url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/11","repository_url":"https://api.github.com/repos/nonplus/angular-ui-router-title","labels_url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/11/comments","events_url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/11/events","html_url":"https://github.com/nonplus/angular-ui-router-title/issues/11","id":212084892,"number":11,"title":"ngAnnotate just miss the $rootScope with default sample.","user":{"login":"mutoo","id":710607,"avatar_url":"https://avatars0.githubusercontent.com/u/710607?v=3","gravatar_id":"","url":"https://api.github.com/users/mutoo","html_url":"https://github.com/mutoo","followers_url":"https://api.github.com/users/mutoo/followers","following_url":"https://api.github.com/users/mutoo/following{/other_user}","gists_url":"https://api.github.com/users/mutoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mutoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mutoo/subscriptions","organizations_url":"https://api.github.com/users/mutoo/orgs","repos_url":"https://api.github.com/users/mutoo/repos","events_url":"https://api.github.com/users/mutoo/events{/privacy}","received_events_url":"https://api.github.com/users/mutoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-06T10:44:29Z","updated_at":"2017-03-15T17:36:39Z","closed_at":null,"body":"I was using the ngAnnotate and uglifyjs in my project. \r\n\r\nWhen I introduced the sample code into my file, it breaked the page after build.\r\n\r\n```\r\n$titleProvider.documentTitle(function($rootScope) {\r\n    return $rootScope.$title ? $rootScope.$title + \" - My Application\" : \"My Application\";\r\n});\r\n```\r\n\r\nIt took a long time to find the reason before I awared that there is a dependency injection of $rootScope. \r\n\r\nSo I manually add the annotation for the sample code:\r\n\r\n```\r\n$titleProvider.documentTitle([\"$rootScope\", function($rootScope) {\r\n    return $rootScope.$title ? $rootScope.$title + \" - My Application\" : \"My Application\";\r\n}]);\r\n```\r\n\r\nor you can just use the \"ngInject\" directive:\r\n\r\n```\r\n$titleProvider.documentTitle(function($rootScope) {\r\n    \"ngInject\";\r\n    return $rootScope.$title ? $rootScope.$title + \" - My Application\" : \"My Application\";\r\n});\r\n```\r\n\r\nit works again!\r\n"},"comment":{"url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/comments/286820758","html_url":"https://github.com/nonplus/angular-ui-router-title/issues/11#issuecomment-286820758","issue_url":"https://api.github.com/repos/nonplus/angular-ui-router-title/issues/11","id":286820758,"user":{"login":"theanxy","id":92843,"avatar_url":"https://avatars2.githubusercontent.com/u/92843?v=3","gravatar_id":"","url":"https://api.github.com/users/theanxy","html_url":"https://github.com/theanxy","followers_url":"https://api.github.com/users/theanxy/followers","following_url":"https://api.github.com/users/theanxy/following{/other_user}","gists_url":"https://api.github.com/users/theanxy/gists{/gist_id}","starred_url":"https://api.github.com/users/theanxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theanxy/subscriptions","organizations_url":"https://api.github.com/users/theanxy/orgs","repos_url":"https://api.github.com/users/theanxy/repos","events_url":"https://api.github.com/users/theanxy/events{/privacy}","received_events_url":"https://api.github.com/users/theanxy/received_events","type":"User","site_admin":false},"created_at":"2017-03-15T17:36:39Z","updated_at":"2017-03-15T17:36:39Z","body":"I confirm, the fix above addressed errors in my project as well. Thanks @mutoo!"}}
{"actor":{"display_login":"theanxy"}}