Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code to fix IE 10 placeholder bug for Angular JS
config(['$provide', function($provide) {
$provide.decorator('$sniffer', ['$delegate', function($sniffer) {
var msie = parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent)) || [])[1], 10);
var _hasEvent = $sniffer.hasEvent;
$sniffer.hasEvent = function(event) {
if (event === 'input' && msie === 10) {
return false;
}
_hasEvent.call(this, event);
}
return $sniffer;
}]);
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment