我的问题是,当从控制器设置mb-tabs的selectedIndex时,如果所选标签不在第一页中,它将不会更改页面以显示所选标签。
我的模板:
<md-content class="md-padding">
<md-tabs md-selected="selectedIndex" md-dynamic-height >
<md-tab label="Nuove (2)" >
<md-content class="md-padding">
<table cellpadding="0" cellspacing="0" class="c12">
<tbody>
<tr class="c0">
<td>
<div><strong>Chiamata{{selectedIndex}}</strong></div>
</td>
<td>
<div><strong>Cliente</strong></div>
</td>
</tr>
</tbody>
</table>
</md-content>
</md-tab>
<md-tab label="Oggi (4)" >
<md-content class="md-padding">
<table cellpadding="0" cellspacing="0" class="c12">
<tbody>
<tr class="c0">
<td>
<div><strong>Chiamata{{selectedIndex}}</strong></div>
</td>
<td>
<div><strong>Cliente</strong></div>
</td>
</tr>
</tbody>
</table>
</md-content>
</md-tab>
<md-tab label="Domani (3)" >
<md-content class="md-padding">
<table cellpadding="0" cellspacing="0" class="c12">
<tbody>
<tr class="c0">
<td>
<div><strong>Chiamata{{selectedIndex}}</strong></div>
</td>
<td>
<div><strong>Cliente</strong></div>
</td>
</tr>
</tbody>
</table>
</md-content>
</md-tab>
<md-tab label="Sospese" >
<md-content class="md-padding">
<table cellpadding="0" cellspacing="0" class="c12">
<tbody>
<tr class="c0">
<td>
<div><strong>Chiamata{{selectedIndex}}</strong></div>
</td>
<td>
<div><strong>Cliente</strong></div>
</td>
</tr>
</tbody>
</table>
</md-content>
</md-tab>
<md-tab label="Pianificate (4)" >
<md-content class="md-padding">
<table cellpadding="0" cellspacing="0" class="c12">
<tbody>
<tr class="c0">
<td>
<div><strong>Chiamata{{selectedIndex}}</strong></div>
</td>
<td>
<div><strong>Cliente</strong></div>
</td>
</tr>
</tbody>
</table>
</md-content>
</md-tab>
</md-tabs>
我的控制器:
.controller("ElencoChiamateController", ["$rootScope", "$scope", "$routeParams", "$routeParams", "$location", "$filter", "$timeout", "$interval", "$mdBottomSheet", "$log", function(e, t, n, n, o, r, a, i, d, l) {
e.id='MIT0650';
//per posizionarsi al tab selezionato
switch(n.quale) {
case 'nuove':
t.selectedIndex = 0;
break;
case 'oggi':
t.selectedIndex = 1;
break;
case 'domani':
t.selectedIndex = 2;
break;
case 'sospese':
t.selectedIndex = 3;
break;
case 'pianificate':
t.selectedIndex = 4;
break;
case 'dsb':
t.selectedIndex = 5;
break;
default: t.selectedIndex = 0;
}
}])
我认为它会更改页面以显示所选标签,但它不会。 我没有找到任何选择,任何建议?