Yeah, if I put a set timeout in there it works, but I hate doing that. I am trying to populate my side menu from the database and the menu is bound to an array. So, when the data does not come back early enough it crashes. But, this should all be able to work using promises and/or async await.
Fix your template so it only expects the data when it arrives, Simplest solution is probably to use the async pipe. Don’t use setTimeout. A user with slow internet will see a runtime error, but you might not in testing if your internet is fast.