Answer

The answer is no, it won’t work. And here’s why:

When the page loads and we read and pass the category id to the search component — the search component is in the middle of fetching the categories.

In the meantime, it realises that you passed a category id to set the category selector with it, and thus tries to match the id you passed with the id of the categories available in the component.

But, alas — we’re still fetching the data, so we don’t have any categories to match!

So the result is that the selector does not show any category as selected.

Fix

There’s an easy fix for this (though I’m not quite sure if this is a best practice (Netanel Basal mind to share your thoughts on this?):

We convert the getEntity query which is a synchronous operation with selectEntity , which basically does the same — only with an observable.

So you can lock the subscription with the category id you passed to the search component:

this.categoryQuery.selectEntity(changes.selectedCategoryId.currentValue).subscribe((category) => { this.selectedCategory = category });