refactor(ionTabs): make navView be detected in link function

This commit is contained in:
Andy Joslin
2014-04-30 08:47:41 -06:00
parent 288d4ac230
commit d8d9362ff9
2 changed files with 5 additions and 4 deletions

View File

@@ -52,9 +52,6 @@ function($rootScope, $animate, $ionicBind, $compile) {
controller: '$ionicTab',
scope: true,
compile: function(element, attr) {
var navView = element[0].querySelector('ion-nav-view') ||
element[0].querySelector('data-ion-nav-view');
var navViewName = navView && navView.getAttribute('name');
//We create the tabNavTemplate in the compile phase so that the
//attributes we pass down won't be interpolated yet - we want
@@ -80,6 +77,10 @@ function($rootScope, $animate, $ionicBind, $compile) {
var tabsCtrl = ctrls[0];
var tabCtrl = ctrls[1];
var navView = tabContent[0].querySelector('ion-nav-view') ||
tabContent[0].querySelector('data-ion-nav-view');
var navViewName = navView && navView.getAttribute('name');
$ionicBind($scope, $attr, {
animate: '=',
onSelect: '&',

View File

@@ -26,7 +26,7 @@ IonicModule
tabCtrl = ctrls[1];
//Remove title attribute so browser-tooltip does not apear
// $element[0].removeAttribute('title');
$element[0].removeAttribute('title');
$scope.selectTab = function(e) {
e.preventDefault();