diff --git a/hacking/TabAngular.js b/hacking/TabAngular.js index 3b4ce48629..e0a7765401 100644 --- a/hacking/TabAngular.js +++ b/hacking/TabAngular.js @@ -34,11 +34,11 @@ angular.module('ionic.ui', ['ngTouch']) $scope.$watch('controllers', function(newV, oldV) { console.log("CControlelrs changed", newV, oldV); - $scope.$apply(); + //$scope.$apply(); }); }) -.directive('tabs', function() { +.directive('tabController', function() { return { restrict: 'E', replace: true, @@ -55,17 +55,17 @@ angular.module('ionic.ui', ['ngTouch']) }) // Generic controller directive -.directive('tabController', function() { +.directive('tabContent', function() { return { - restrict: 'E', + restrict: 'CA', replace: true, transclude: true, template: '
', - require: '^tabs', - scope: { - title: '@' - }, + require: '^tabController', + scope: true, link: function(scope, element, attrs, tabsCtrl) { + scope.title = attrs.title; + scope.icon = attrs.icon; tabsCtrl.addController(scope); } } @@ -75,9 +75,10 @@ angular.module('ionic.ui', ['ngTouch']) .directive('tabBar', function() { return { restrict: 'E', - require: '^tabs', + require: '^tabController', transclude: true, replace: true, + scope: true, template: '