{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11193","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11193/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11193/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11193/events","html_url":"https://github.com/angular/angular.js/issues/11193","id":59096693,"number":11193,"title":"AngularJS binding does not update when IE's clear button is clicked","user":{"login":"dprothero","id":1897006,"avatar_url":"https://avatars.githubusercontent.com/u/1897006?v=3","gravatar_id":"","url":"https://api.github.com/users/dprothero","html_url":"https://github.com/dprothero","followers_url":"https://api.github.com/users/dprothero/followers","following_url":"https://api.github.com/users/dprothero/following{/other_user}","gists_url":"https://api.github.com/users/dprothero/gists{/gist_id}","starred_url":"https://api.github.com/users/dprothero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dprothero/subscriptions","organizations_url":"https://api.github.com/users/dprothero/orgs","repos_url":"https://api.github.com/users/dprothero/repos","events_url":"https://api.github.com/users/dprothero/events{/privacy}","received_events_url":"https://api.github.com/users/dprothero/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/browser:%20IE11","name":"browser: IE11","color":"207de5"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20bug","name":"type: bug","color":"000000"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/38","html_url":"https://github.com/angular/angular.js/milestones/Ice%20Box","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/38/labels","id":529901,"number":38,"title":"Ice Box","description":"Milestone for valid issues and bugs that we have no aspirations on fixing any time soon because they are not affecting primary use-cases and are not aligned with our goals.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":179,"closed_issues":136,"state":"open","created_at":"2014-01-08T08:19:21Z","updated_at":"2015-10-27T18:25:14Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-02-26T16:21:33Z","updated_at":"2015-10-27T20:31:46Z","closed_at":null,"body":"IE has an \"X\" in each text input that will clear the input. However, when clicking this button, while it clears the textbox, it does not update the Angular model that the input is bound to.\r\n\r\n````\r\n<input type=\"text\" ng-model=\"name\" />\r\n````\r\n\r\nSee http://jsfiddle.net/p5x1zwr9/ for an example of the behavior.\r\n\r\nSee http://youtu.be/LFaEwliTzpQ for a video of the behavior.\r\n\r\nI am using IE 11.\r\n\r\nThis actually worked in AngularJS versions prior to 1.3.6 so this may be a new Angular bug."},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/151635136","html_url":"https://github.com/angular/angular.js/issues/11193#issuecomment-151635136","issue_url":"https://api.github.com/repos/angular/angular.js/issues/11193","id":151635136,"user":{"login":"Tim91084","id":5086428,"avatar_url":"https://avatars.githubusercontent.com/u/5086428?v=3","gravatar_id":"","url":"https://api.github.com/users/Tim91084","html_url":"https://github.com/Tim91084","followers_url":"https://api.github.com/users/Tim91084/followers","following_url":"https://api.github.com/users/Tim91084/following{/other_user}","gists_url":"https://api.github.com/users/Tim91084/gists{/gist_id}","starred_url":"https://api.github.com/users/Tim91084/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tim91084/subscriptions","organizations_url":"https://api.github.com/users/Tim91084/orgs","repos_url":"https://api.github.com/users/Tim91084/repos","events_url":"https://api.github.com/users/Tim91084/events{/privacy}","received_events_url":"https://api.github.com/users/Tim91084/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T20:31:46Z","updated_at":"2015-10-27T20:31:46Z","body":"I'm using this directive to resolve the issue..\r\n\r\n    angular\r\n        .module('yourModule')\r\n        .directive('input', FixIEClearButton);\r\n\r\n    FixIEClearButton.$inject = ['$timeout', '$sniffer'];\r\n\r\n    function FixIEClearButton($timeout, $sniffer) {\r\n        var directive = {\r\n            restrict: 'E',\r\n            require: '?ngModel',\r\n            link: Link,\r\n            controller: function () { }\r\n        };\r\n\r\n        return directive;\r\n\r\n        function Link(scope, elem, attr, controller) {\r\n            var type = elem[0].type;\r\n            //ie11 doesn't seem to support the input event, at least according to angular\r\n            if (type !== 'text' || !controller || $sniffer.hasEvent('input')) {\r\n                return;\r\n            }\r\n            \r\n            elem.on(\"mouseup\", function (event) {\r\n                var oldValue = elem.val();\r\n                if (oldValue == \"\") {\r\n                    return;\r\n                }\r\n\r\n                $timeout(function () {\r\n                    var newValue = elem.val();\r\n                    if (newValue !== oldValue) {\r\n                        elem.val(oldValue);\r\n                        elem.triggerHandler('keydown');\r\n                        elem.val(newValue);\r\n                        elem.triggerHandler('focus');\r\n                    }\r\n                }, 0, false);\r\n            });\r\n\r\n            scope.$on('$destroy', destroy);\r\n            elem.on('$destroy', destroy);\r\n\r\n            function destroy() {\r\n                elem.off('mouseup');\r\n            }\r\n        }\r\n    }"}}