Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 974b6d4

Browse files
committed
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.
1 parent 952fea6 commit 974b6d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ng/sniffer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ function $SnifferProvider() {
8383
csp: csp(),
8484
vendorPrefix: vendorPrefix,
8585
transitions : transitions,
86-
animations : animations
86+
animations : animations,
87+
msie : msie
8788
};
8889
}];
8990
}

test/ng/snifferSpec.js

+4
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,8 @@ describe('$sniffer', function() {
333333
});
334334
});
335335
});
336+
337+
it('should return true for msie when internet explorer is being used', inject(function($sniffer) {
338+
expect($sniffer.msie > 0).toBe(window.navigator.appName == 'Microsoft Internet Explorer');
339+
}));
336340
});

0 commit comments

Comments
 (0)