In a non angular application we can respond to window resize events with the following:
window.onresize = function(event) {
console.log('changed');
};
However we can't use this in angular applications since it's a bad practice to directly access the window object. How would we implement the above functionality in the 'angular' way?