1

In some browsers (ex ie7) where angular is not working I want to display a message telling the user to have his browser updated or use another one.

The way I am doing this is

<div ng-if="false">Browser not supported</div>

If the angular cannot render then the ng-if will not be processed so the div is displayed.

This is also causing a flicker when testing for pages with protractor because the protractor is going from page to page very fast.

My question is: Does anyone have a better solution of treating this kind of situation?

7
  • First of all don't promote old browsers and expect new things.Its better to move on and only use new browsers :-D Commented Feb 19, 2015 at 16:32
  • Check this topic - stackoverflow.com/questions/12709745/… Commented Feb 19, 2015 at 16:35
  • You could use modernizr for feature detection before even loading angular or you could use vanilla JS to sniff the UA using navigator and if IE7 do something (using feature detection is preferred over UA sniffing in general though). Commented Feb 19, 2015 at 16:52
  • @squiroid, @vtorosyan: I'm not promoting legacy browsers but i`m trying to find a fix so that users don't have an unpleasant experience if their browser does not support angularJS (not only IE7 but also small browsers that don't support this like android default browser). And mainly, you cannot force a user to change it's behavior based on your product, it's you who has to align to the market if you wish to be a valid competitor Commented Feb 20, 2015 at 14:48
  • @mxa055 there must be a more elegant solution that to use a plugin to display that angular has broken but your solution seems to work. hopefully someone will find a more elegant way of doing this. thanks Commented Feb 20, 2015 at 14:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.