mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-19 16:10:22 +00:00
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; });
This commit is contained in:
parent
d54dfecb00
commit
aaedefb92e
2 changed files with 2 additions and 8 deletions
|
|
@ -1,7 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* @ngdoc object
|
||||
* !!! This is an undocumented "private" service !!!
|
||||
*
|
||||
* @name angular.module.ng.$sniffer
|
||||
* @requires $window
|
||||
*
|
||||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue