How to get device width and height

Please show some code, you injected $window in yoru conrtoller, right?