Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e3e52c2

Browse files
author
Robert Messerle
committed
fix(tabs): nested tabs should now work properly when using md-tab-label
and md-tab-body Closes #3206
1 parent 83a50f2 commit e3e52c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/tabs/js/tabDirective.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function MdTab () {
6969
return getLabelElement() || getLabelAttribute() || getElementContents();
7070
function getLabelAttribute () { return attr.label; }
7171
function getLabelElement () {
72-
var label = element.find('md-tab-label');
72+
var label = element.find('md-tab-label').eq(0);
7373
if (label.length) return label.remove().html();
7474
}
7575
function getElementContents () {
@@ -79,7 +79,7 @@ function MdTab () {
7979
}
8080
}
8181
function getTemplate () {
82-
var content = element.find('md-tab-body'),
82+
var content = element.find('md-tab-body').eq(0),
8383
template = content.length ? content.html() : attr.label ? element.html() : '';
8484
if (content.length) content.remove();
8585
else if (attr.label) element.empty();
@@ -99,8 +99,8 @@ function MdTab () {
9999
if (!ctrl) return;
100100
var tabs = element.parent()[0].getElementsByTagName('md-tab'),
101101
index = Array.prototype.indexOf.call(tabs, element[0]),
102-
body = element.find('md-tab-body').remove(),
103-
label = element.find('md-tab-label').remove(),
102+
body = element.find('md-tab-body').eq(0).remove(),
103+
label = element.find('md-tab-label').eq(0).remove(),
104104
data = ctrl.insertTab({
105105
scope: scope,
106106
parent: scope.$parent,

0 commit comments

Comments
 (0)