Angular - two subscriptions in ngOnInit result in object 'undefined'
问题 In short.. I am not able to access my news object. It is coming back as 'undefined' when called in a function. In my ngOnInit I have two subscriptions. First one returns a news object (which is defined as a global variable at the top of the component). The second subscription returns a route parameter and then triggers a function (navigateToArticle). Now... when the second subscription triggers the 'navigateToArticle' function, I want that function to be able to access the news object.