Reputation: 75670
In the absence of proper CSS3 support, I have a javascript function that keeps our layout looking nice.
var handleWindowResize = function() {
// Code omitted because i don't think it's relevant
};
It needs to be invoked in the following scenarios
Where is the best place to put this sort of code in an AngularJS app?
Upvotes: 2
Views: 304
Reputation: 48147
You don't want to do this in a controller. Controllers should not reference the DOM. Instead, you want to create a directive to do this. Create a directive that describes our behavior, like "maintain-layout" and put your behavior in that directive.
Upvotes: 2