{"action":"created","issue":{"url":"https://api.github.com/repos/pbastowski/angular2-now/issues/8","labels_url":"https://api.github.com/repos/pbastowski/angular2-now/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/pbastowski/angular2-now/issues/8/comments","events_url":"https://api.github.com/repos/pbastowski/angular2-now/issues/8/events","html_url":"https://github.com/pbastowski/angular2-now/issues/8","id":90134821,"number":8,"title":"race condition in setting angular.module to SetModule;","user":{"login":"Huck","id":1425008,"avatar_url":"https://avatars.githubusercontent.com/u/1425008?v=3","gravatar_id":"","url":"https://api.github.com/users/Huck","html_url":"https://github.com/Huck","followers_url":"https://api.github.com/users/Huck/followers","following_url":"https://api.github.com/users/Huck/following{/other_user}","gists_url":"https://api.github.com/users/Huck/gists{/gist_id}","starred_url":"https://api.github.com/users/Huck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huck/subscriptions","organizations_url":"https://api.github.com/users/Huck/orgs","repos_url":"https://api.github.com/users/Huck/repos","events_url":"https://api.github.com/users/Huck/events{/privacy}","received_events_url":"https://api.github.com/users/Huck/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-22T15:38:17Z","updated_at":"2015-06-23T13:11:55Z","closed_at":"2015-06-23T13:11:55Z","body":"We are using angular2-now and its pretty amazing.  \r\n\r\nwe found a bug where there seems to be a race condition between angular and angular2-now where angular.module is not always set to SetModule;  By using angualr2now the usual way, our app doesnt always load becuase this override of angular.module is not always set.  When we add the below code at the top of out .ts file to our app, then it loads correctly every time:\r\n\r\nangular.module = angular2now.SetModule;\r\n\r\nexample in typescript with system.js transpiling:\r\n\r\n\r\nimport * as angular2now from 'angular2-now';\r\n\r\nvar {Component, View, bootstrap} = angular2now;\r\n\r\nconsole.log(angular.version);\r\nangular2now.options({ controllerAs: 'vm' });\r\n// this below seems to be very important due to a bug in angular2-now\r\nangular.module = angular2now.SetModule;\r\n\r\nangular.module('foo',  [ ]);\r\n\r\nclass ...\r\n\r\nbootstrap...\r\n"},"comment":{"url":"https://api.github.com/repos/pbastowski/angular2-now/issues/comments/114495107","html_url":"https://github.com/pbastowski/angular2-now/issues/8#issuecomment-114495107","issue_url":"https://api.github.com/repos/pbastowski/angular2-now/issues/8","id":114495107,"user":{"login":"Huck","id":1425008,"avatar_url":"https://avatars.githubusercontent.com/u/1425008?v=3","gravatar_id":"","url":"https://api.github.com/users/Huck","html_url":"https://github.com/Huck","followers_url":"https://api.github.com/users/Huck/followers","following_url":"https://api.github.com/users/Huck/following{/other_user}","gists_url":"https://api.github.com/users/Huck/gists{/gist_id}","starred_url":"https://api.github.com/users/Huck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huck/subscriptions","organizations_url":"https://api.github.com/users/Huck/orgs","repos_url":"https://api.github.com/users/Huck/repos","events_url":"https://api.github.com/users/Huck/events{/privacy}","received_events_url":"https://api.github.com/users/Huck/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T13:11:55Z","updated_at":"2015-06-23T13:11:55Z","body":"Hi,\r\n\r\nreplacing all angular.module with angular2now.SetModule('foo',[]);  works like a charm. We will stick to this from now on.  \r\n\r\nby the way, thanks for your library, its really nice.\r\n\r\nregards\r\n\r\n"}}