Angular tests running, content scoping

This commit is contained in:
Max Lynch
2013-10-02 19:47:21 -05:00
parent 4174fc3d49
commit a7fbaac5db
6 changed files with 95 additions and 30 deletions

View File

@ -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');
}
}
}
}
})