ViewportSize is a simple and easy-to-use AngularJS service which gives access to the viewport's height and width.
- Install via bower by running
$ bower install angular-viewport-size
from your terminal. - Add
'common.viewport-size'
to your module's list of dependencies.
Simply call viewportSize.height
or viewportSize.width
and you'll get back the expected result as a number.
These two properties, height and width, are defined as getters for simplicity sake.