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
Download the from here
bower install ng-ismobile
- Add ng-ismobile.js to your main file (index.html)
<script type="text/javascript" src="bower_components/ng-ismobile/dist/ng-ismobile.js"></script>
- Set
ngIsMobile
as a dependency in your module
var myapp = angular.module('myapp', ['ngIsMobile'])
- 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
This project was initially forked from the application template seed here https://github.com/codehangar/ng-copy-text.git