{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/10208","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/10208/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/10208/comments","events_url":"https://api.github.com/repos/angular/angular/issues/10208/events","html_url":"https://github.com/angular/angular/issues/10208","id":166821122,"number":10208,"title":"Http.get returned observables don't trigger a change detection","user":{"login":"leonceeo","id":5182657,"avatar_url":"https://avatars.githubusercontent.com/u/5182657?v=3","gravatar_id":"","url":"https://api.github.com/users/leonceeo","html_url":"https://github.com/leonceeo","followers_url":"https://api.github.com/users/leonceeo/followers","following_url":"https://api.github.com/users/leonceeo/following{/other_user}","gists_url":"https://api.github.com/users/leonceeo/gists{/gist_id}","starred_url":"https://api.github.com/users/leonceeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonceeo/subscriptions","organizations_url":"https://api.github.com/users/leonceeo/orgs","repos_url":"https://api.github.com/users/leonceeo/repos","events_url":"https://api.github.com/users/leonceeo/events{/privacy}","received_events_url":"https://api.github.com/users/leonceeo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20http","name":"comp: http","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"assignees":[{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-07-21T13:36:55Z","updated_at":"2016-08-13T22:11:08Z","closed_at":null,"body":"**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[x] bug report\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nUsing angular2-rc.4\r\n\r\nI have a rxjs Observable returned by a _http.get(...)_ operation. I'm subscribing to it, however the model changes which occur in the subscription don't get reflected in the UI. Invoking the _http.get(...)_ operation once again triggers the UI updates which should have happened previously.\r\n\r\nIf I convert the Observable to a Promise, things work as expected. The Promise subscription modifies the variables which in turn trigger the angular change detection.\r\n\r\nI've noticed that the rxjs subscribing function doesn't get called inside a ngzone.\r\n\r\n> VM43288 app.ts!transpiled:48 console.trace()(anonymous function) @ VM43288 app.ts!transpiled:48SafeSubscriber.__tryOrUnsub @ VM43294 Subscriber.js:225SafeSubscriber.next @ VM43294 \r\nSubscriber.js:174Subscriber._next @ VM43294 \r\nSubscriber.js:124Subscriber.next @ VM43294 \r\nSubscriber.js:88Subscriber._next @ VM43294 \r\nSubscriber.js:124Subscriber.next @ VM43294 \r\nSubscriber.js:88MapSubscriber._next @ VM43306 \r\nmap.js:82Subscriber.next @ VM43294 \r\nSubscriber.js:88onLoad @ VM43634 \r\nxhr_backend.js:68\r\n\r\nPromise subscription get's called inside a ngzone\r\n\r\n> (anonymous function)\t@\tVM43288 app.ts!transpiled:55\r\nZoneDelegate.invoke\t@\tVM43271 zone.js@0.6.12:281\r\nonInvoke\t@\tVM43368 ng_zone_impl.js:53\r\nZoneDelegate.invoke\t@\tVM43271 zone.js@0.6.12:280\r\nZone.run\t@\tVM43271 zone.js@0.6.12:174\r\n(anonymous function)\t@\tVM43271 zone.js@0.6.12:529\r\nZoneDelegate.invokeTask\t@\tVM43271 zone.js@0.6.12:314\r\nonInvokeTask\t@\tVM43368 ng_zone_impl.js:44\r\nZoneDelegate.invokeTask\t@\tVM43271 zone.js@0.6.12:313\r\nZone.runTask\t@\tVM43271 zone.js@0.6.12:214\r\ndrainMicroTaskQueue\t@\tVM43271 zone.js@0.6.12:432\r\n\r\n\r\n**Expected/desired behavior**\r\nI'm expecting the Observable subscription to work the same as the Promise subscription.\r\n\r\n**Reproduction of the problem**\r\n[Plunker](https://embed.plnkr.co/fC4XMB/)\r\n\r\nThe app displays two buttons. On the first button, I'm using rxjs observables, on the second one js promises. A click on the first button doesn't show anything, a second event is necessary in order to trigger change detection. The second button reacts on the first click.\r\n\r\n**What is the expected behavior?**\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n\r\n**Please tell us about your environment:**\r\n\r\n* **Angular version:** 2.0.0-rc.4\r\n \r\n* **Browser:** [Chrome 53.0.2785.8 | Firefox 47.0 | Safari 9.1.1 ] \r\n \r\n* **Language:** [TypeScript 1.8] \r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/239644097","html_url":"https://github.com/angular/angular/issues/10208#issuecomment-239644097","issue_url":"https://api.github.com/repos/angular/angular/issues/10208","id":239644097,"user":{"login":"sunshineo","id":1072766,"avatar_url":"https://avatars.githubusercontent.com/u/1072766?v=3","gravatar_id":"","url":"https://api.github.com/users/sunshineo","html_url":"https://github.com/sunshineo","followers_url":"https://api.github.com/users/sunshineo/followers","following_url":"https://api.github.com/users/sunshineo/following{/other_user}","gists_url":"https://api.github.com/users/sunshineo/gists{/gist_id}","starred_url":"https://api.github.com/users/sunshineo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunshineo/subscriptions","organizations_url":"https://api.github.com/users/sunshineo/orgs","repos_url":"https://api.github.com/users/sunshineo/repos","events_url":"https://api.github.com/users/sunshineo/events{/privacy}","received_events_url":"https://api.github.com/users/sunshineo/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T22:11:08Z","updated_at":"2016-08-13T22:11:08Z","body":"+1\r\nI'm experiencing this with the Safari browser only.\r\nI had to use the solution here[http://stackoverflow.com/questions/37980271/angular-2-ui-not-updating-when-items-added-to-array-on-image-onload] to manually trigger change detection."}}
{"actor":{"display_login":"sunshineo"}}