Last active
August 29, 2015 14:03
-
-
Save dlabey/152e59555dc60dc723ed to your computer and use it in GitHub Desktop.
Angular Window Resize Directive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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