Is there any in-built services/directives/routes to change the view (or page using routing) based on the type of browser/platform the user is accessing from? I’d like phones and tablets to have a different view than desktop users.
Is there any in-built services/directives/routes to change the view (or page using routing) based
Share
I don’t know of anything built into Angular, but you can do this by inserting logic into your routing rules. For example:
In this example, if getBrowser() returns
'iphone'it will render the viewiphone.htmlYou can use
BrowserDetect to do what the name implies.
fiddle example for Chrome and Firefox detection