How to deteact INTERNET EXPLORER (IE) browser and its version using ANGULAR.JS

I need to deteact if my website user are using internet explorer browser and its version is less than 10 then i need to a message to my site visitors that "You are using unsupported browser version and the site may not function correctly" like below screen shot in angular js :



Below is my code that i write in my main file app.js :

var app = angular.module('clientApp', ['ngRoute', 'ngCookies']).run(function($rootScope,Restangular) {

var isIE = false || !!document.documentMode;

if(isIE && document.documentMode<10){
    $rootScope.iemsg = 'You are on an unsupported browser version and the site may not function correctly. Our site works best on IE10/FF/Safari/Chrome";
}

});

Below is my html code to display warning message using bootstrap:

<div class="alert alert-error" ng-if="iemsg"><i class="btn-icon-only icon-warning-sign"></i>{{iemsg}}</div>

Don't forgot to leave a comment if you like this post or having any trouble while using this code.



Chears :)
Happy Coding..

Post a Comment

Previous Post Next Post