Not quite sure if this is an anti-pattern maybe someone could shed some light on if there us a better way of doing it.
I have bound a re-size event on the window and also want to trigger the same code on load. IS this the correct way to do this?
angular.element($window).bind("resize", function (event) {
// code here
}).trigger("resize");
fiddle below.