This ember addon provides a simple way to detect the IE or Edge browsers and their version.
ember install ember-cli-ie-detect
The method is available as a service, injected into files.
export default Ember.Controller.extend({
ieDetect: Ember.inject.service(),
})
After injecting the service, it's pretty straight forward to use.
this.get('ieDetect.version') >= 12 // Edge
this.get('ieDetect.version') < 12 // IE
this.get('ieDetect.version') === false // Not IE or Edge
Simple as that.
This addon is based on a codepen by Mario Pizzinini.