Skip to content

$state.reload instead of broadcastUpdate? #242

@vbraun

Description

@vbraun

Background: I'm having some interop issues with angular-material, e.g. #214 or angular/material#1742. In both cases the initial render is ok, but subsequent changes of the language via setCurrentLanguage(...) don't produce the desired effect.

My current workaround is to just flip the language variable and reload the current state:

    gettextCatalog.currentLanguage = ...
    $state.reload()

I realize that this uses ui-router and loses content of <input> fields, on the other hand it is more robust since you only have to be able to render once. Another advantage is that you can use one-time bindings {{::"Text"|translate}}. Is there any other issue that I haven't thought about? Would there be interest to "bless" this workaround by adding a special setter setCurrentLanguageAndReload, say?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions