Tutorialsplane

AngularJs Get Browser Viewport Dimensions


AngularJs Get Browser Viewport Dimensions : We can get the browser viewport height and width using the JavaScript. Here in this tutorial we are going to explain how you can get the browser Viewport height and width using the JavaScript. You can use our online editor to edit and run the code online.


AngularJs Get Browser Viewport Dimensions Using JavaScript

You can use the following JavaScript to get the browser’s viewport height and width as below-

AngularJs Get Browser Viewport Dimensions :




 
 

  
<div ng-app="myApp">  
<div ng-controller="myController"> 

 <button ng-click="getViewportDim()">Get Dim</button><br/>
 Height = {{height}}PX<br/>
 Width = {{width}}PX<br/>

</div> 
</div>
  
      

Try it »

If you run the above example it will produce output something like this –