0

How can I add class to an element if user is opening page in Internet explorer?

ng-class="{ie : navigator.appName == 'Microsoft Internet Explorer'}"
Richa
  • 4,240
  • 5
  • 33
  • 50
  • [Related](http://stackoverflow.com/questions/22947535/how-to-detect-browser-using-angular) – Ankh May 05 '16 at 11:01
  • Another related - http://stackoverflow.com/questions/31678743/ng-class-if-browser-is-not-internet-explorer - you'd just use the opposite of what they're doing – Rob Scott May 05 '16 at 11:04

1 Answers1

0

A basic solution to your problem is, first detect browser and store it to a variable. Then write a conditional expression in your ng-class depending on your browser. Two great related article is already given in the comment section.

Sk. Tajbir
  • 290
  • 2
  • 9