AngularJS router to use different template for Mobile and Desktop

In your AngularJS application, if you want to use different templates/views for mobile and desktop users then following script may be useful for you. What we have done here is, just wrote a function named as “_isNotMobile”. This function will return true/false by checking user agent of device. And also we have used that function inside AngularJs app’s router, before actually specifying template/view paths and that’s it! Simple!

 

One Reply to “AngularJS router to use different template for Mobile and Desktop”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.