Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
isObservable(res) instead of isObservable(res.subscribe)
I changed the usage of isObservable function to the correct one. Previously, it checks the subscribe function itself while it should check the observable itself. I also add a test that describes in which case it could lead to problem.
Without my fix the test is red and the actual result is
"{"operator": [Function anonymous], "source": {"_subscribe": [Function anonymous]}}"
With my fix the test is green.
In my test I described the scenario of a race condition when there is a bit delay of loading new language translation (after switching) and the usage MissingHandler with observable takes place.
P.S.
In many cases the next tick will solve the problem and user will see the correct translation, but there is a chance to see the stringified observable
"{"operator": [Function anonymous], "source": {"_subscribe": [Function anonymous]}}"
In my PR I also removed some redundat imports.