mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
Simpler content area and fixed nav ctrl
This commit is contained in:
22
js/ext/angular/src/directive/ionicNav.js
vendored
22
js/ext/angular/src/directive/ionicNav.js
vendored
@ -34,27 +34,31 @@ angular.module('ionic.ui.nav', ['ionic.service.templateLoad', 'ionic.service.ges
|
||||
this.endDrag = function(e) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a template onto the navigation stack.
|
||||
* @param {string} templateUrl the URL of the template to load.
|
||||
*/
|
||||
this.pushFromTemplate = function(templateUrl) {
|
||||
var childScope = $scope.$new();
|
||||
childScope.isVisible = true;
|
||||
|
||||
// Load the given template
|
||||
TemplateLoader.load(templateUrl).then(function(templateString) {
|
||||
|
||||
// Compile the template with the new scrope, and append it to the navigation's content area
|
||||
var el = $compile(templateString)(childScope, function(cloned, scope) {
|
||||
angular.element($element[0].children[1].firstElementChild).append(cloned);
|
||||
var content = $element[0].querySelector('.content');
|
||||
angular.element(content).append(cloned);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Push a controller to the stack. This is called by the child
|
||||
* nav-content directive when it is linked to a scope on the page.
|
||||
*/
|
||||
$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;
|
||||
|
||||
Reference in New Issue
Block a user