md-tabs: just switching tabs causes over 60 digests (was infinite in earlier versions)
When switching tabs in an md-tabs container, the digest process seems to be called many more times than necessary. I have an example where it is called around 60 times in Firefox (15 times in Chrome), although no data changes in the scope.
The html is like this:
<md-tabs flex md-border-bottom md-selected="selectedTab" >
<md-tab label="A">
<md-content class="md-padding">
<div ng-if="isTeamAdmin(null)">stuff</div>
</md-content>
</md-tab>
<md-tab label="B">
</md-tab>
</md-tabs>
And the controller is like this:
angular.module("docflow").controller("BooksListCtrl",
["$scope", "$rootScope",
function($scope, $rootScope){
$scope.isTeamAdmin = function() {
console.log("isTeamAdmin");
return false;
};
}]);
The isTeamAdmin function is called 60+ times when switching tabs.
Here is a Meteor app that reproduces the problem:
https://github.com/gpothier/mdTabIssues
Note: with previous versions of Angular and Material, the isTeamAdmin function was being called again and again forever, so it seems a kind of failsafe now kicks in, but still the method should be called only once.
Just confirming that the version that caused infinite digests is 0.9.8. In 0.9.10 it is "only" 60.
Can you confirm this issue still exists with the 0.10 release ?
Oooh sorry, I did mean 0.10.0, not 0.9.10. So yes, I confirm that in 0.10.0 digest is executed around 60 times, and in 0.9.8 it was executed forever.
Now that the infinite digest issue has been fixed, this is probably the next major perf issue with tabs.
I've updated a codepen that shows digest executions when tabs are interacted with to use the version which fixes #3101
http://codepen.io/stevenmiles/pen/RPxOgL
Down to 10 in Firefox now.
@robertmesserle - from infinite -> 10... #ftw