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

Commit aaedefb

Browse files
committed
refactor($sniffer): make $sniffer service private
This service has been accidentaly documented in the past, it should not be considered to be public api. I'm also removing fallback to Modernizr since we don't need it. Breaks any app that depends on this service and its fallback to Modernizr, please migrate to custom "Modernizr" service: module.value('Modernizr', function() { return Modernizr; });
1 parent d54dfec commit aaedefb

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

Diff for: src/service/sniffer.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

33
/**
4-
* @ngdoc object
4+
* !!! This is an undocumented "private" service !!!
5+
*
56
* @name angular.module.ng.$sniffer
67
* @requires $window
78
*
@@ -13,8 +14,6 @@
1314
*/
1415
function $SnifferProvider(){
1516
this.$get = ['$window', function($window){
16-
if ($window.Modernizr) return $window.Modernizr;
17-
1817
return {
1918
history: !!($window.history && $window.history.pushState),
2019
hashchange: 'onhashchange' in $window &&

Diff for: test/service/snifferSpec.js

-5
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,4 @@ describe('$sniffer', function() {
3030
expect(sniffer({onhashchange: true, document: {documentMode: 7}}).hashchange).toBe(false);
3131
});
3232
});
33-
34-
it('should use Modernizr if defined', function() {
35-
var Modernizr = {};
36-
expect(sniffer({Modernizr: Modernizr})).toBe(Modernizr);
37-
});
3833
});

0 commit comments

Comments
 (0)