Directive for displaying different html elements on mobile and not mobile browsers using only one page.
This project is maintained by cyberdelphos
Clone this repository:
$ git clone https://github.com/cyberdelphos/angular-only-mobile.git
If you're using the GitHub for Mac, simply sync this repository and you'll see the new branch.
This repository contains the directive 'only-mobile' that works with AngularJS.
This directive makes it simple to show html elements in web browsers and mobile browsers using the same html page.
To use this directive you have to:
only-mobile
' to your html element< ... only-mobile="true" />
< ... only-mobile="false" />
Just don't append anything to your html element ;)
Load this page in your phone and computer browsers to see this directive in action.
By taking a look at that rather simple page containing this directive in use
you can notice the span shown only in mobile (I will be shown only in mobile
), and the one only shown
in pc browsers (I will be shown only in pc
).
This directive is created by A. Carrasco (@cyberdelphos) and can be used under the MIT License.
The function used to check mobile browsers is the one created by detectmobilebrowsers.com, so the credit for mobile browser detection goes to them.