Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TranslateDirective): update dom content on lang change
- Loading branch information
Showing
2 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocombe Before this directive I had a simple directive which did the below and with that I was able to to do
<p translate="my.foo.key"></p>
is there anyway to retain the behavior so that I dont have to rewrite my entire sourcecode to do<p [translate]="'my.foo.key'"></p>
?This is what I used to have
a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good news,
<p translate="my.foo.key"></p>
should already work with the directive :)a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm for some reason it doesnt work for me. let me dig deeper
a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok with v4.2.0 this seems to work but somehow the directive doesnt update the content when I switch languages dynamically. The pipe works in the same setup
a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm this shouldn't be the case, can you open a bug with a plunkr please?
a209ad2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.