Skip to content

Instantly share code, notes, and snippets.

@sunnycyk
Created May 18, 2013 09:18
Show Gist options
  • Save sunnycyk/5603832 to your computer and use it in GitHub Desktop.
Save sunnycyk/5603832 to your computer and use it in GitHub Desktop.
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