Angular2 Change Detection when app is first loaded

312 views Asked by At

So when I first load my app only the static content is loaded i.e. the content where I have async pipes is not rendered at all (usually one that is supposed to be rendered after server response). Dynamic content only loads once I hover over a link or something. It feels like Change detection is not triggered at all. Would anyone have any idea why would this happen? Any help would be highly appreciated. Been stuck on this for a while now. Thanks.

1

There are 1 answers

0
Sam On BEST ANSWER

If the request to the server is made asynchronously, then you may need to manually update the UI once you receive the response.

EDIT: it looks like in Angular2 You might need to use NgZone. See this article for details:

http://orizens.com/wp/topics/angular-2-ngzone-intro-the-new-scope-apply/