Skip to content

TranslateService.stream premature translation  #815

@fjozsef

Description

@fjozsef

I'm submitting a ... (check one with "x")

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
TranslateService.stream can miss language changes when there has not been subscribed to the Observable created of it.

Expected/desired behavior
TranslateService.stream shouldn't make the first translation when it is called. Only when someone is subscribing to its Observable.

Reproduction of the problem
http://plnkr.co/edit/iI7WDj9ht9xwHbLPNNrz
The french translation should be shown, but the english text is displayed.

Please tell us about your environment:
See in plunker.

Known workaround
Wrap the Observable created by stream with defer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions