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

Commit

Permalink
refactor($sniffer): make $sniffer service private
Browse files Browse the repository at this point in the history
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; });
  • Loading branch information
IgorMinar committed Mar 26, 2012
1 parent d54dfec commit aaedefb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/service/sniffer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

/**
* @ngdoc object
* !!! This is an undocumented "private" service !!!
*
* @name angular.module.ng.$sniffer
* @requires $window
*
Expand All @@ -13,8 +14,6 @@
*/
function $SnifferProvider(){
this.$get = ['$window', function($window){
if ($window.Modernizr) return $window.Modernizr;

return {
history: !!($window.history && $window.history.pushState),
hashchange: 'onhashchange' in $window &&
Expand Down
5 changes: 0 additions & 5 deletions test/service/snifferSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,4 @@ describe('$sniffer', function() {
expect(sniffer({onhashchange: true, document: {documentMode: 7}}).hashchange).toBe(false);
});
});

it('should use Modernizr if defined', function() {
var Modernizr = {};
expect(sniffer({Modernizr: Modernizr})).toBe(Modernizr);
});
});

0 comments on commit aaedefb

Please sign in to comment.