(function(ionic) {
'use strict';
angular.module('ionic.ui.header', ['ngAnimate'])
.directive('headerBar', function() {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '',
scope: {
leftButtons: '=',
rightButtons: '=',
title: '=',
type: '@',
alignTitle: '@'
},
link: function($scope, $element, $attr) {
var hb = new ionic.views.HeaderBar({
el: $element[0],
alignTitle: $scope.alignTitle || 'center'
});
$element.addClass($scope.type);
$scope.headerBarView = hb;
$scope.$watch('leftButtons', function(val) {
// Resize the title since the buttons have changed
hb.align();
});
$scope.$watch('rightButtons', function(val) {
// Resize the title since the buttons have changed
hb.align();
});
$scope.$watch('title', function(val) {
// Resize the title since the title has changed
console.log('Title changed');
hb.align();
});
}
};
})
.directive('footerBar', function() {
return {
restrict: 'E',
replace: true,
transclude: true,
template: '',
scope: {
type: '@',
},
link: function($scope, $element, $attr) {
$element.addClass($scope.type);
}
};
});
})(ionic);