From 974b6d4a5b402c9911aef8adf2f3d30aae1ba8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Sat, 2 Nov 2013 13:25:38 -0400 Subject: [PATCH] chore($sniffer): make msie variable public The msie variable is a global variable used within the ng core which contains the version number for the current Internet Explorer browser that is rendering the application. Other modules outside of the ng core could make use of this variable instead of having to rollout duplicate detection code. This code makes it easy to reuse this simple property within the $sniffer service. --- src/ng/sniffer.js | 3 ++- test/ng/snifferSpec.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 8dcfcd7d1e34..9a1438d39ec2 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -83,7 +83,8 @@ function $SnifferProvider() { csp: csp(), vendorPrefix: vendorPrefix, transitions : transitions, - animations : animations + animations : animations, + msie : msie }; }]; } diff --git a/test/ng/snifferSpec.js b/test/ng/snifferSpec.js index 6e9dc830439a..9ab317d2e54c 100644 --- a/test/ng/snifferSpec.js +++ b/test/ng/snifferSpec.js @@ -333,4 +333,8 @@ describe('$sniffer', function() { }); }); }); + + it('should return true for msie when internet explorer is being used', inject(function($sniffer) { + expect($sniffer.msie > 0).toBe(window.navigator.appName == 'Microsoft Internet Explorer'); + })); });