rest - AngularJS different template based on User Agent -
is a Spring MVC app I have departed to JSON. I am planning to use AngularJS as my front end and it wants to use different templates based on user agent (desktop / mobile). Do I know that it is worth using AngularJS? if so, how? Is this a better way?
It has not tested it myself, but I think it could work:
$ scope.userAgent = navigator.userAgent; & Lt; Some-template ng-if = "useragent === 'firefox'" & gt; & Lt; Some other templates ng-if = "userAgent! == 'Firefox'" & gt; Have you tried using Navigator.User Agent?
Another option, I think, is to use the solution by going to the U-Router. Then run some Nevigetrkyusr agent is lookup service, and decide on the appropriate template before providing visual - to reduce the amount of NG-Oops
This is just conjecture at this stage, let it go and see What works / does not, good luck :)
Comments
Post a Comment