mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-19 08:21:03 +08: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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user