I am looking to retrieve the current screen resolution of my clients' browsers for calculation purposes. The function I plan to use is as follows:
scope.$watch('**??what,should,go,here??**', function() {
scope.screen = (window.innerWidth / 2) - 150;
});
While attempting to use a regular $watch function, I encountered an issue with determining what exactly to watch. Initially, I tried watching window.innerWidth but found this approach to be ineffective as it only provides a value once. I believe there must be a simpler solution that I'm overlooking.
Any assistance would be greatly appreciated. Thank you.