{"action":"created","issue":{"url":"https://api.github.com/repos/rev087/ng-inspector/issues/67","labels_url":"https://api.github.com/repos/rev087/ng-inspector/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/rev087/ng-inspector/issues/67/comments","events_url":"https://api.github.com/repos/rev087/ng-inspector/issues/67/events","html_url":"https://github.com/rev087/ng-inspector/issues/67","id":54909576,"number":67,"title":"Doesn't work when angular is loaded async","user":{"login":"tandyjames","id":3828013,"avatar_url":"https://avatars.githubusercontent.com/u/3828013?v=3","gravatar_id":"","url":"https://api.github.com/users/tandyjames","html_url":"https://github.com/tandyjames","followers_url":"https://api.github.com/users/tandyjames/followers","following_url":"https://api.github.com/users/tandyjames/following{/other_user}","gists_url":"https://api.github.com/users/tandyjames/gists{/gist_id}","starred_url":"https://api.github.com/users/tandyjames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tandyjames/subscriptions","organizations_url":"https://api.github.com/users/tandyjames/orgs","repos_url":"https://api.github.com/users/tandyjames/repos","events_url":"https://api.github.com/users/tandyjames/events{/privacy}","received_events_url":"https://api.github.com/users/tandyjames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-20T17:02:37Z","updated_at":"2015-01-21T15:38:00Z","closed_at":null,"body":"I load angular with RequireJS... it isn't loaded when the app first starts.\r\nTherefore I have to bootstrap it manually.\r\nYou overwrite window.angular.bootstrap and save off the original... however, when you save off the original, it hasn't loaded in my code yet.\r\nNet result.. my angular app never bootstraps when this extension is loaded."},"comment":{"url":"https://api.github.com/repos/rev087/ng-inspector/issues/comments/70859077","html_url":"https://github.com/rev087/ng-inspector/issues/67#issuecomment-70859077","issue_url":"https://api.github.com/repos/rev087/ng-inspector/issues/67","id":70859077,"user":{"login":"tandyjames","id":3828013,"avatar_url":"https://avatars.githubusercontent.com/u/3828013?v=3","gravatar_id":"","url":"https://api.github.com/users/tandyjames","html_url":"https://github.com/tandyjames","followers_url":"https://api.github.com/users/tandyjames/followers","following_url":"https://api.github.com/users/tandyjames/following{/other_user}","gists_url":"https://api.github.com/users/tandyjames/gists{/gist_id}","starred_url":"https://api.github.com/users/tandyjames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tandyjames/subscriptions","organizations_url":"https://api.github.com/users/tandyjames/orgs","repos_url":"https://api.github.com/users/tandyjames/repos","events_url":"https://api.github.com/users/tandyjames/events{/privacy}","received_events_url":"https://api.github.com/users/tandyjames/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T15:38:00Z","updated_at":"2015-01-21T15:38:00Z","body":"This is really weird, but I figured it out... here's what I know:\r\nYou determine if angular is loaded with:\r\n    if ('angular' in window) {\r\nbut angularJs determines it like this:\r\n    if (window.angular.bootstrap) {\r\n\r\nFor some reason, one of my pages uses a module which defines an angular object... but not the full object (ie. not angular.bootstrap).\r\nSo if I run without your extension... angular doesn't see angular.bootstrap and still loads.\r\nIf I run with your extension... your extension defines angular.bootstrap, then when angular run it assumes the angular has already been loaded and doesn't load.\r\n\r\nIf you change your check to the same one that angular uses... it would not crash. As a side note, I should maybe find out which library is defining the angular object and make sure it's loaded after angular. But I still think matching angulars method will be the most robust for your extension.\r\n\r\nLet me know what you think.\r\n\r\n"}}