angular.module('ionic.ui.nav', ['ionic.service']) .controller('NavCtrl', ['$scope', '$element', '$compile', 'TemplateLoader', function($scope, $element, $compile, TemplateLoader) { var _this = this; angular.extend(this, ionic.controllers.NavController.prototype); this.pushFromTemplate = function(tmpl) { data = TemplateLoader.load(tmpl).then(function(data) { console.log('Nav loaded template', data); var childScope = $scope.$new(); childScope.isVisible = true; $compile(data)(childScope, function(cloned, scope) { $element.append(cloned); }); }); } ionic.controllers.NavController.call(this, { content: { }, navBar: { shouldGoBack: function() { }, show: function() { this.isVisible = true; }, hide: function() { this.isVisible = false; }, setTitle: function(title) { $scope.navController.title = title; }, showBackButton: function(show) { }, } }); $scope.pushController = function(scope) { _this.push(scope); }; $scope.navController = this; }]) .directive('navCtrl', function() { return { restrict: 'E', replace: true, transclude: true, controller: 'NavCtrl', //templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html', template: '
', } }) .directive('navBar', function() { return { restrict: 'E', require: '^navCtrl', replace: true, scope: true, template: '