Tabs label one way binding not allowing translating their text
Hi, when I change my site language it can't change tabs label text:
<md-tabs md-dynamic-height md-border-bottom>
<md-tab>
<md-tab-label><span>{{ 'DESCRIPTION' | translate }}</span></md-tab-label>
<md-tab-body>
<div class="text-description">
{{ description }}
</div>
</md-tab-body>
</md-tab>
</md-tabs>
I tried using md-tab label attribute and it continues without working. am i doing something wrong or is it a bug?
Thanks
@franciscopuyo Can you provide a CodePen to demonstrate this? What you are doing looks right, so if it's not working, I will need to add a fix.
@franciscopuyo This seems to be an issue with how filters work. This will work if you wrap your label in a function that applies the filter, but will not work with just the filter.
Sample: http://codepen.io/robertmesserle/pen/265ceab91d77537e3e39151a6835f5d5/?editors=001
This seems to be how Angular works. The same problem exists even if you remove tabs altogether:
http://codepen.io/robertmesserle/pen/dd45876671285958d32acad27896a41a?editors=101
Closing for now, but maybe open an issue against AngularJS for this.
Sorry, I tried to figure out how show it using codepen but I couldn't load all the dependecies.
I've also tried wrapping the label into a function but it doesn't work.
$scope.translate = function() {
return $scope.translation;
}
$rootScope.$on('$translateChangeSuccess', function () {
$translate('DESCRIPTION').then(function (translation) {
$scope.translation= translation;
});
});
<md-tabs md-dynamic-height md-border-bottom>
<md-tab>
<md-tab-label>{{ translate() }}</md-tab-label>
<md-tab-body>
<div class="text-description">
{{ description }}
</div>
</md-tab-body>
</md-tab>
</md-tabs>
Do you have the issue code? so I can follow it.
Really thanks