Skip to content

Angular module to check whether the screen is of mobile or not.

License

Notifications You must be signed in to change notification settings

rob-in/ng-ismobile

Repository files navigation

ng-ismobile - AngularJS module to check screen is of mobile or not

Build Status

A simple AngularJS module that checks your browser's screen size and return you true or false on the basis of below condition.

if(screenWidth < 480px), it will consider it as mobile browser

How to get it ?

Manual Download

Download the from here

Bower

bower install ng-ismobile

Usage

  1. Add ng-ismobile.js to your main file (index.html)
<script type="text/javascript" src="bower_components/ng-ismobile/dist/ng-ismobile.js"></script>
  1. Set ngIsMobile as a dependency in your module
var myapp = angular.module('myapp', ['ngIsMobile'])
  1. User $rootScope.IS_MOBILE_SCREEN variable in your application:
$rootScope.IS_MOBILE_SCREEN === true; //current browser is of mobile
$rootScope.IS_MOBILE_SCREEN === false; //current browser is of tablet/desktop/other

Credits

This project was initially forked from the application template seed here https://github.com/codehangar/ng-copy-text.git

About

Angular module to check whether the screen is of mobile or not.

Resources

License

Stars

Watchers

Forks

Packages