mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Angular tests running, content scoping
This commit is contained in:
20
js/ext/angular/src/directive/ionicContent.js
vendored
20
js/ext/angular/src/directive/ionicContent.js
vendored
@ -6,18 +6,18 @@ angular.module('ionic.ui.content', {})
|
||||
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) {
|
||||
scope: false,
|
||||
compile: function(element, attr, transclude) {
|
||||
return function($scope, $element, $attr) {
|
||||
$scope.hasHeader = attr.hasHeader;
|
||||
$scope.hasTabs = attr.hasTabs;
|
||||
$element.addClass('content');
|
||||
|
||||
var newScope = $scope.$parent.$new();
|
||||
|
||||
$element.append(transclude(newScope));
|
||||
};
|
||||
if(attr.hasHeader) {
|
||||
$element.addClass('has-header');
|
||||
}
|
||||
if(attr.hasTabs) {
|
||||
$element.addClass('has-tabs');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user