Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service to detect IE #60

Open
mitogh opened this issue Apr 27, 2016 · 0 comments
Open

Service to detect IE #60

mitogh opened this issue Apr 27, 2016 · 0 comments

Comments

@mitogh
Copy link
Member

mitogh commented Apr 27, 2016

Steps to reproduce and a minimal demo of the problem

Sometimes is useful to detect in directives if we are under a IE version to generate fallback solutions

Current behavior

Nothing is present

Expected/desired behavior

I think if we add a new service that we can use consistency might be useful, here is the code of the service implemented in other project.

import angular from 'angular';

angular
  .module('app')
  .factory('ie', ie);

function ie() {
  return {
    isActive: isActive,
    isEdge: isEdge,
    is11: isIE11,
    isOld: isOldVersion
  };
  function isActive(){
    return isEdge() || isIE11() || isOldVersion();
  }
  function isEdge(){
    return /Edge/.test(navigator.userAgent);
  }
  function isIE11(){
    return /Trident.*rv[ :]*11./.test(navigator.userAgent);
  }
  function isOldVersion(){
    return /MSIE/.test(navigator.appVersion);
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant