{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/66143472","id":66143472,"diff_hunk":"@@ -552,22 +552,32 @@ angular.module('ngMessages', [])\n         $templateRequest(src).then(function(html) {\n           if ($scope.$$destroyed) return;\n \n-          $compile(html)($scope, function(contents) {\n-            element.after(contents);\n-\n-            // the anchor is placed for debugging purposes\n-            var comment = $compile.$$createComment ?\n-                $compile.$$createComment('ngMessagesInclude', src) :\n-                $document[0].createComment(' ngMessagesInclude: ' + src + ' ');\n-            var anchor = jqLite(comment);\n-            element.after(anchor);\n-\n-            // we don't want to pollute the DOM anymore by keeping an empty directive element\n-            element.remove();\n-          });\n+          if (isString(html) && !html.trim()) {","path":"src/ngMessages/messages.js","position":null,"original_position":17,"commit_id":"f4199c2da371e107b324bd4e2213874dd69d05da","original_commit_id":"f4199c2da371e107b324bd4e2213874dd69d05da","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"body":"The `isString()` is needed in case the request returns some non-string data. This is normally not the case, but can happen (especially in tests).","created_at":"2016-06-07T20:12:30Z","updated_at":"2016-06-07T20:12:30Z","html_url":"https://github.com/angular/angular.js/pull/14726#discussion_r66143472","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/14726","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/66143472"},"html":{"href":"https://github.com/angular/angular.js/pull/14726#discussion_r66143472"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14726"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/14726","id":72841923,"html_url":"https://github.com/angular/angular.js/pull/14726","diff_url":"https://github.com/angular/angular.js/pull/14726.diff","patch_url":"https://github.com/angular/angular.js/pull/14726.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/14726","number":14726,"state":"open","locked":false,"title":"feat(ngMessagesInclude): don't break on empty (or whitespace-only) templates","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"body":"**What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)**\r\nFeature (or bug fix - depends)\r\n\r\n**What is the current behavior? (You can also link to an open issue here)**\r\nUsing `ngMessagesInclude` with an empty template, throws an error. This happens, because when trying to `$compile` the template, jqLite thinks we are trying to call it with a selector.\r\nSee #12941.\r\n\r\n**What is the new behavior (if this is a feature change)?**\r\nUsing `ngMessagesInclude` with an empty template (or a template that contains only whitespace), will not throw.\r\n\r\n**Does this PR introduce a breaking change?**\r\nOnly if you relied on `ngMessagesInclude` throwing an error on empty templates.\r\n\r\n**Please check if the PR fulfills these requirements**\r\n- [x] The commit message follows our guidelines: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format\r\n- [x] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] ~~Docs have been added / updated (for bug fixes / features)~~\r\n\r\n**Other information**:\r\nFixes #12941.","created_at":"2016-06-07T09:24:22Z","updated_at":"2016-06-07T20:12:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7092229a3f34bc43153e8ae83843e9268e8651f","assignee":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/90","html_url":"https://github.com/angular/angular.js/milestones/1.5.x","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/90/labels","id":1025270,"number":90,"title":"1.5.x","description":"","creator":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"open_issues":114,"closed_issues":138,"state":"open","created_at":"2015-03-17T12:15:49Z","updated_at":"2016-06-07T18:13:19Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/14726/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/14726/comments","review_comment_url":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/14726/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/f4199c2da371e107b324bd4e2213874dd69d05da","head":{"label":"gkalpak:feat-ngMessageInclude-support-empty-template","ref":"feat-ngMessageInclude-support-empty-template","sha":"f4199c2da371e107b324bd4e2213874dd69d05da","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"repo":{"id":23513120,"name":"angular.js","full_name":"gkalpak/angular.js","owner":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gkalpak/angular.js","description":"HTML enhanced for web apps","fork":true,"url":"https://api.github.com/repos/gkalpak/angular.js","forks_url":"https://api.github.com/repos/gkalpak/angular.js/forks","keys_url":"https://api.github.com/repos/gkalpak/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gkalpak/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gkalpak/angular.js/teams","hooks_url":"https://api.github.com/repos/gkalpak/angular.js/hooks","issue_events_url":"https://api.github.com/repos/gkalpak/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/gkalpak/angular.js/events","assignees_url":"https://api.github.com/repos/gkalpak/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/gkalpak/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/gkalpak/angular.js/tags","blobs_url":"https://api.github.com/repos/gkalpak/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gkalpak/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gkalpak/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/gkalpak/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gkalpak/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/gkalpak/angular.js/languages","stargazers_url":"https://api.github.com/repos/gkalpak/angular.js/stargazers","contributors_url":"https://api.github.com/repos/gkalpak/angular.js/contributors","subscribers_url":"https://api.github.com/repos/gkalpak/angular.js/subscribers","subscription_url":"https://api.github.com/repos/gkalpak/angular.js/subscription","commits_url":"https://api.github.com/repos/gkalpak/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/gkalpak/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/gkalpak/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/gkalpak/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/gkalpak/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/gkalpak/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gkalpak/angular.js/merges","archive_url":"https://api.github.com/repos/gkalpak/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gkalpak/angular.js/downloads","issues_url":"https://api.github.com/repos/gkalpak/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/gkalpak/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/gkalpak/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/gkalpak/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gkalpak/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/gkalpak/angular.js/releases{/id}","deployments_url":"https://api.github.com/repos/gkalpak/angular.js/deployments","created_at":"2014-08-31T12:31:10Z","updated_at":"2016-01-11T10:14:26Z","pushed_at":"2016-06-07T09:15:21Z","git_url":"git://github.com/gkalpak/angular.js.git","ssh_url":"git@github.com:gkalpak/angular.js.git","clone_url":"https://github.com/gkalpak/angular.js.git","svn_url":"https://github.com/gkalpak/angular.js","homepage":"http://angularjs.org","size":82327,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"2f618459b2102ab7119ecd2055457e33b9a1cd2b","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":460078,"name":"angular.js","full_name":"angular/angular.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.js","description":"HTML enhanced for web apps","fork":false,"url":"https://api.github.com/repos/angular/angular.js","forks_url":"https://api.github.com/repos/angular/angular.js/forks","keys_url":"https://api.github.com/repos/angular/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.js/teams","hooks_url":"https://api.github.com/repos/angular/angular.js/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.js/events","assignees_url":"https://api.github.com/repos/angular/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.js/tags","blobs_url":"https://api.github.com/repos/angular/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.js/languages","stargazers_url":"https://api.github.com/repos/angular/angular.js/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.js/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.js/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.js/subscription","commits_url":"https://api.github.com/repos/angular/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.js/merges","archive_url":"https://api.github.com/repos/angular/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.js/downloads","issues_url":"https://api.github.com/repos/angular/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.js/releases{/id}","deployments_url":"https://api.github.com/repos/angular/angular.js/deployments","created_at":"2010-01-06T00:34:37Z","updated_at":"2016-06-07T18:23:00Z","pushed_at":"2016-06-07T17:34:55Z","git_url":"git://github.com/angular/angular.js.git","ssh_url":"git@github.com:angular/angular.js.git","clone_url":"https://github.com/angular/angular.js.git","svn_url":"https://github.com/angular/angular.js","homepage":"http://angularjs.org","size":187953,"stargazers_count":49756,"watchers_count":49756,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23998,"mirror_url":null,"open_issues_count":967,"forks":23998,"open_issues":967,"watchers":49756,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14726"},"html":{"href":"https://github.com/angular/angular.js/pull/14726"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/14726"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/14726/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14726/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.js/pulls/14726/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/f4199c2da371e107b324bd4e2213874dd69d05da"}}}}
{"actor":{"display_login":"gkalpak"}}