md-tab's label has only one-time binding
with this code:
<md-tab label="{{ 'WEAK_POINTS' | translate }}">
tab title is converted to (without ng-binding):
<span class="ng-scope">Weak points</span>
if I change the language, tab title doesn't change the translation.
I think you mean has a scope isolation (one way binding)?
yes It's one way binding, I just checked the code (line 62):
scope: {
label: '@',
active: '=?mdActive',
disabled: '=?ngDisabled',
select: '&?mdOnSelect',
deselect: '&?mdOnDeselect'
},
and line 76:
data = ctrl.insertTab({
scope: scope,
parent: scope.$parent,
index: index,
template: getTemplate(),
label: getLabel()
}, index);
label doesn't have two way binding, nor $scope.$watch for label (only for 'active','disabled' and tab item)
The way I do it :
<md-tab-label>
<span ng-bind-html="str_Name | translate"></span>
</md-tab-label>
you may want to alter the span or div inside the md-tab-label, so it covers all surface. You can hack the label to be a flexbox, remove all paddings/margins and stretch the span inside.
thanks for the hint, didn't know we could use tag "md-tab-label" ^^ but it's still a bug IMO.
Not a bug : You're not supposed to tie angular-translate to the angular-material directive, which is a module that has nothing to do with angular-material.
I think that's why they built the encapsulated system, so we could fill the md-tab-labels, md-tab-items and the md-tab-contents with whatever html we want (filter and directives included).
Don't forget to use md-tab-body.
@bonatoc
I think it's a bug. Fix it please