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

Commit

Permalink
fix(tabs): reduces the number of watchers by using bind-once syntax f…
Browse files Browse the repository at this point in the history
…or non-changing items

Related to #3272
  • Loading branch information
Robert Messerle committed Jul 7, 2015
1 parent d3416df commit 6f63d70
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/components/tabs/js/tabsDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
style="max-width: {{ tabWidth ? tabWidth + \'px\' : \'none\' }}"\
ng-repeat="tab in $mdTabsCtrl.tabs"\
role="tab"\
aria-controls="tab-content-{{tab.id}}"\
aria-controls="tab-content-{{::tab.id}}"\
aria-selected="{{tab.isActive()}}"\
aria-disabled="{{tab.scope.disabled || \'false\'}}"\
ng-click="$mdTabsCtrl.select(tab.getIndex())"\
Expand All @@ -149,32 +149,32 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
ng-disabled="tab.scope.disabled"\
md-swipe-left="$mdTabsCtrl.nextPage()"\
md-swipe-right="$mdTabsCtrl.previousPage()"\
md-template="tab.label"\
md-scope="tab.parent"></md-tab-item>\
md-template="::tab.label"\
md-scope="::tab.parent"></md-tab-item>\
<md-ink-bar ng-hide="$mdTabsCtrl.noInkBar"></md-ink-bar>\
</md-pagination-wrapper>\
<div class="md-visually-hidden md-dummy-wrapper">\
<md-dummy-tab\
class="md-tab"\
tabindex="-1"\
id="tab-item-{{tab.id}}"\
id="tab-item-{{::tab.id}}"\
role="tab"\
aria-controls="tab-content-{{tab.id}}"\
aria-controls="tab-content-{{::tab.id}}"\
aria-selected="{{tab.isActive()}}"\
aria-disabled="{{tab.scope.disabled || \'false\'}}"\
ng-focus="$mdTabsCtrl.hasFocus = true"\
ng-blur="$mdTabsCtrl.hasFocus = false"\
ng-repeat="tab in $mdTabsCtrl.tabs"\
md-template="tab.label"\
md-scope="tab.parent"></md-dummy-tab>\
md-template="::tab.label"\
md-scope="::tab.parent"></md-dummy-tab>\
</div>\
</md-tabs-canvas>\
</md-tabs-wrapper>\
<md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent">\
<md-tab-content\
id="tab-content-{{tab.id}}"\
id="tab-content-{{::tab.id}}"\
role="tabpanel"\
aria-labelledby="tab-item-{{tab.id}}"\
aria-labelledby="tab-item-{{::tab.id}}"\
md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementSelectedIndex(1)"\
md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementSelectedIndex(-1)"\
ng-if="$mdTabsCtrl.hasContent"\
Expand All @@ -188,8 +188,8 @@ function MdTabs ($mdTheming, $mdUtil, $compile) {
\'md-no-scroll\': $mdTabsCtrl.dynamicHeight\
}">\
<div\
md-template="tab.template"\
md-scope="tab.parent"\
md-template="::tab.template"\
md-scope="::tab.parent"\
ng-if="tab.shouldRender()"></div>\
</md-tab-content>\
</md-tabs-content-wrapper>\
Expand Down

0 comments on commit 6f63d70

Please sign in to comment.