In this article, we will see how to get the dimensions of the Viewport in AngularJS.
- The approach is to use clientWidth and innerWidth property.
- The maximum of these values should be the width and height respectively.
Example 1: In this example, the height and width are calculated in pixels.
Example 2: In this example, the height and width are calculated in centimeters.
- How to get card vertically centered between search bar and bottom of the viewport?
- HTML | Viewport meta tag for Responsive Web Design
- How to Set Calc Viewport Units Workaround in CSS ?
- jQuery | Dimensions
- How to dynamically get the content width of a div using AngularJS ?
- How to dynamically get the content height of a div using AngularJS ?
- How to get the current URL using AngularJS ?
- How to get the value of radio button using AngularJS ?
- How to get form input value using AngularJS ?
- How to set, get and clear cookies in AngularJs?
- How to get file content and other details in AngularJS?
- Alternative of ng-checked to get the checkbox's state in AngularJS
- How to convert string into a number using AngularJS ?
- Include Bootstrap in AngularJS using ng-bootstrap
- How to print an array in table format using angularJS?
- How to reload or re-render the entire page using AngularJS?
- How to directly update a field by using ng-click in AngularJS ?
- How to filter ng-repeat values according to ng-model using AngularJS ?
- How to Reset an Input Value when Limit Exceeds using AngularJS ?
- How to change the date format using AngularJS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.