mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Angular cleanup and content working
This commit is contained in:
46
js/ext/angular/src/directive/ionicContent.js
vendored
Normal file
46
js/ext/angular/src/directive/ionicContent.js
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
angular.module('ionic.ui.content', {})
|
||||
|
||||
/*
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
template: '<div class="content"></div>'
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
hasHeader: '@',
|
||||
hasTabs: '@'
|
||||
},
|
||||
template: '<div class="content" ng-class="{\'has-header\': hasHeader, \'has-tabs\': hasTabs}" ng-transclude></div>'
|
||||
}
|
||||
})
|
||||
*/
|
||||
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: true,
|
||||
template: '<div class="content" ng-class="{\'has-header\': hasHeader, \'has-tabs\': hasTabs}"></div>',
|
||||
compile: function(element, attr, transclude, navCtrl) {
|
||||
return function($scope, $element, $attr) {
|
||||
$scope.hasHeader = attr.hasHeader;
|
||||
$scope.hasTabs = attr.hasTabs;
|
||||
|
||||
var newScope = $scope.$parent.$new();
|
||||
|
||||
$element.append(transclude(newScope));
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,24 +1,8 @@
|
||||
angular.module('ionic.ui', ['ngTouch'])
|
||||
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: true,
|
||||
template: '<div class="content" ng-class="{\'has-header\': hasHeader, \'has-tabs\': hasTabs}"></div>',
|
||||
compile: function(element, attr, transclude, navCtrl) {
|
||||
return function($scope, $element, $attr) {
|
||||
$scope.hasHeader = attr.hasHeader;
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
angular.module('ionic.ui.nav', ['ionic.ui'])
|
||||
|
||||
.controller('NavCtrl', function($scope, $element, $compile) {
|
||||
var _this = this;
|
||||
|
||||
|
||||
angular.extend(this, ionic.controllers.NavController.prototype);
|
||||
|
||||
ionic.controllers.NavController.call(this, {
|
||||
@ -42,7 +26,6 @@ angular.module('ionic.ui', ['ngTouch'])
|
||||
}
|
||||
|
||||
$scope.pushController = function(controller) {
|
||||
//console.log('PUSHING OCNTROLLER', controller);
|
||||
_this.push(controller);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
angular.module('ionic.ui', [])
|
||||
angular.module('ionic.ui.sideMenu', [])
|
||||
|
||||
.controller('SideMenuCtrl', function($scope) {
|
||||
var _this = this;
|
||||
@ -1,17 +1,4 @@
|
||||
angular.module('ionic.ui', [])
|
||||
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
hasHeader: '@',
|
||||
hasTabs: '@'
|
||||
},
|
||||
template: '<div class="content" ng-class="{\'has-header\': hasHeader, \'has-tabs\': hasTabs}" ng-transclude></div>'
|
||||
}
|
||||
})
|
||||
angular.module('ionic.ui.tabs', ['ionic.ui.content'])
|
||||
|
||||
.controller('TabsCtrl', function($scope) {
|
||||
var _this = this;
|
||||
9
js/ext/angular/src/ionicContent.js
vendored
9
js/ext/angular/src/ionicContent.js
vendored
@ -1,9 +0,0 @@
|
||||
angular.module('ionic.ui.content', {})
|
||||
|
||||
.directive('content', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
template: '<div class="content"></div>'
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user