Skip to content

Instantly share code, notes, and snippets.

@tkh44
Created March 24, 2014 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkh44/9749241 to your computer and use it in GitHub Desktop.
Save tkh44/9749241 to your computer and use it in GitHub Desktop.
So you can have a fixed button container at the bottom of your ng-view
ticketApp.directive('fixedButtonContainer', function($timeout) {
return {
restrict: 'A',
scope: {
mainView: '@'
},
link: function($scope, $element, attrs) {
$scope.$container = angular.isDefined($scope.mainView) ? $($scope.mainView): $element.closest('[ng-view]');
if (!$scope.$container) return;
$scope.$container.height($scope.$container.outerHeight(true) + $element.outerHeight(true));
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment