(function() { 'use strict'; angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.gesture', 'ngAnimate']) .controller('NavCtrl', ['$scope', '$element', '$animate', '$compile', 'TemplateLoader', function($scope, $element, $animate, $compile, TemplateLoader) { var _this = this; angular.extend(this, ionic.controllers.NavController.prototype); 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) { }, } }); this.handleDrag = function(e) { }; this.endDrag = function(e) { }; this.pushFromTemplate = function(templateUrl) { var childScope = $scope.$new(); childScope.isVisible = true; TemplateLoader.load(templateUrl).then(function(templateString) { var el = $compile(templateString)(childScope, function(cloned, scope) { angular.element($element[0].children[1].firstElementChild).append(cloned); }); }); }; $scope.pushController = function(scope, element) { _this.push(scope); /* var old = angular.element($element[0].children[1]); $animate.enter(element, $element, $element[0].firstElementChild, function() { }); $animate.leave(old, function() { }); */ }; $scope.navController = this; }]) .directive('navs', 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: '^navs', replace: true, scope: true, template: '