Skip to content

Instantly share code, notes, and snippets.

@dlabey
Last active August 29, 2015 14:03
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 dlabey/152e59555dc60dc723ed to your computer and use it in GitHub Desktop.
Save dlabey/152e59555dc60dc723ed to your computer and use it in GitHub Desktop.
Angular Window Resize Directive
angular.module('namespace').directive('ngWindowResize', function($window, $parse) {
return function(scope, element, attr) { // jshint ignore:line
angular.element($window).bind('resize', function(event) {
$parse(attr.ngWindowResize)(scope, { $event: event, $element: element });
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment