{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/8659","labels_url":"https://api.github.com/repos/angular/angular.js/issues/8659/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/8659/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/8659/events","html_url":"https://github.com/angular/angular.js/issues/8659","id":40525092,"number":8659,"title":"Invalid argument in IE when using $compile","user":{"login":"Matsemann","id":1030544,"avatar_url":"https://avatars.githubusercontent.com/u/1030544?v=3","gravatar_id":"","url":"https://api.github.com/users/Matsemann","html_url":"https://github.com/Matsemann","followers_url":"https://api.github.com/users/Matsemann/followers","following_url":"https://api.github.com/users/Matsemann/following{/other_user}","gists_url":"https://api.github.com/users/Matsemann/gists{/gist_id}","starred_url":"https://api.github.com/users/Matsemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matsemann/subscriptions","organizations_url":"https://api.github.com/users/Matsemann/orgs","repos_url":"https://api.github.com/users/Matsemann/repos","events_url":"https://api.github.com/users/Matsemann/events{/privacy}","received_events_url":"https://api.github.com/users/Matsemann/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/component:%20$compile","name":"component: $compile","color":"e102d8"},{"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/27","html_url":"https://github.com/angular/angular.js/milestones/Backlog","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/27/labels","id":489171,"number":27,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.\r\n\r\nBefore assigning items to this milestone they should be labelled, at the very least with the correct \"type\" label (i.e. \"issue\", \"pr\", \"bug\", \"regression\", \"chore\", \"docs\", etc).  Preferably you should also check for duplicate issues/PRs, note CLA status and assign \"complexity\" and \"impact\" labels too.","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":691,"closed_issues":972,"state":"open","created_at":"2013-11-18T23:30:35Z","updated_at":"2015-09-16T08:07:33Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2014-08-18T19:54:36Z","updated_at":"2015-09-17T12:15:02Z","closed_at":null,"body":"A fiddle with a trivial example: http://jsfiddle.net/1t4crp6e/\r\n\r\n````\r\n<div ng-app=\"myApp\">\r\n    <div ng-controller=\"myctrl\">\r\n        <div test>the value is: {{testmodel}}</div>\r\n        \r\n        <br>\r\n        <input type=\"text\" ng-model=\"testmodel\">\r\n    </div>\r\n</div>\r\n....\r\nlink: function(scope, elm, attrs) {\r\n            var standardText = elm.text();\r\n            \r\n            elm.html('something');\r\n            \r\n            $timeout(function() {\r\n                console.log(standardText);\r\n                elm.html('').append($compile('<span>' + standardText + '</span>')(scope.$parent));\r\n            }, 2000);\r\n        }\r\n```\r\n\r\n\r\nWait 2 secs, see the content of directive change to a binding. In Firefox, everything works. In IE it *works*, but it throws a lot of errors in the console.\r\n(Don't worry about what I'm doing here, I just made a small example showing the issue)\r\n\r\n> Error: Invalid argument.\r\n  at Anonymous function (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:62:80)\r\n   at k.prototype.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:109:350)\r\n   at k.prototype.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:112:343)\r\n   at Anonymous function (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:18:158)\r\n   at d (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:34:474)\r\n   at c (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:18:66)\r\n   at fc (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:18:270)\r\n   at Xc (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:17:362)\r\n   at Anonymous function (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js:214:78)\r\n   at o (https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js:2:14725)\r\n\r\n**However, most of my tries of actually writing this worked in all browsers *except* IE. For instance, if I remove the span in the compile, and instead of elm.text() use elm.contents().**\r\nhttp://jsfiddle.net/1t4crp6e/1/ Only changed line 13 and 19 in the js, breaks horribly in IE. It's almost impossible to compile stuff in IE.\r\n\r\nAm I doing something wrong? And any workarounds?\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/141060358","html_url":"https://github.com/angular/angular.js/issues/8659#issuecomment-141060358","issue_url":"https://api.github.com/repos/angular/angular.js/issues/8659","id":141060358,"user":{"login":"TombolaShepless","id":11768442,"avatar_url":"https://avatars.githubusercontent.com/u/11768442?v=3","gravatar_id":"","url":"https://api.github.com/users/TombolaShepless","html_url":"https://github.com/TombolaShepless","followers_url":"https://api.github.com/users/TombolaShepless/followers","following_url":"https://api.github.com/users/TombolaShepless/following{/other_user}","gists_url":"https://api.github.com/users/TombolaShepless/gists{/gist_id}","starred_url":"https://api.github.com/users/TombolaShepless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TombolaShepless/subscriptions","organizations_url":"https://api.github.com/users/TombolaShepless/orgs","repos_url":"https://api.github.com/users/TombolaShepless/repos","events_url":"https://api.github.com/users/TombolaShepless/events{/privacy}","received_events_url":"https://api.github.com/users/TombolaShepless/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T12:15:02Z","updated_at":"2015-09-17T12:15:02Z","body":"Also experiencing this issue, any word on a timescale for the fix proposed to be implemented?"}}