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

Commit 6f63d70

Browse files
author
Robert Messerle
committed
fix(tabs): reduces the number of watchers by using bind-once syntax for non-changing items
Related to #3272
1 parent d3416df commit 6f63d70

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/components/tabs/js/tabsDirective.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
137137
style="max-width: {{ tabWidth ? tabWidth + \'px\' : \'none\' }}"\
138138
ng-repeat="tab in $mdTabsCtrl.tabs"\
139139
role="tab"\
140-
aria-controls="tab-content-{{tab.id}}"\
140+
aria-controls="tab-content-{{::tab.id}}"\
141141
aria-selected="{{tab.isActive()}}"\
142142
aria-disabled="{{tab.scope.disabled || \'false\'}}"\
143143
ng-click="$mdTabsCtrl.select(tab.getIndex())"\
@@ -149,32 +149,32 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
149149
ng-disabled="tab.scope.disabled"\
150150
md-swipe-left="$mdTabsCtrl.nextPage()"\
151151
md-swipe-right="$mdTabsCtrl.previousPage()"\
152-
md-template="tab.label"\
153-
md-scope="tab.parent"></md-tab-item>\
152+
md-template="::tab.label"\
153+
md-scope="::tab.parent"></md-tab-item>\
154154
<md-ink-bar ng-hide="$mdTabsCtrl.noInkBar"></md-ink-bar>\
155155
</md-pagination-wrapper>\
156156
<div class="md-visually-hidden md-dummy-wrapper">\
157157
<md-dummy-tab\
158158
class="md-tab"\
159159
tabindex="-1"\
160-
id="tab-item-{{tab.id}}"\
160+
id="tab-item-{{::tab.id}}"\
161161
role="tab"\
162-
aria-controls="tab-content-{{tab.id}}"\
162+
aria-controls="tab-content-{{::tab.id}}"\
163163
aria-selected="{{tab.isActive()}}"\
164164
aria-disabled="{{tab.scope.disabled || \'false\'}}"\
165165
ng-focus="$mdTabsCtrl.hasFocus = true"\
166166
ng-blur="$mdTabsCtrl.hasFocus = false"\
167167
ng-repeat="tab in $mdTabsCtrl.tabs"\
168-
md-template="tab.label"\
169-
md-scope="tab.parent"></md-dummy-tab>\
168+
md-template="::tab.label"\
169+
md-scope="::tab.parent"></md-dummy-tab>\
170170
</div>\
171171
</md-tabs-canvas>\
172172
</md-tabs-wrapper>\
173173
<md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent">\
174174
<md-tab-content\
175-
id="tab-content-{{tab.id}}"\
175+
id="tab-content-{{::tab.id}}"\
176176
role="tabpanel"\
177-
aria-labelledby="tab-item-{{tab.id}}"\
177+
aria-labelledby="tab-item-{{::tab.id}}"\
178178
md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementSelectedIndex(1)"\
179179
md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementSelectedIndex(-1)"\
180180
ng-if="$mdTabsCtrl.hasContent"\
@@ -188,8 +188,8 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
188188
\'md-no-scroll\': $mdTabsCtrl.dynamicHeight\
189189
}">\
190190
<div\
191-
md-template="tab.template"\
192-
md-scope="tab.parent"\
191+
md-template="::tab.template"\
192+
md-scope="::tab.parent"\
193193
ng-if="tab.shouldRender()"></div>\
194194
</md-tab-content>\
195195
</md-tabs-content-wrapper>\

0 commit comments

Comments
 (0)