{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material/pulls/comments/83226065","pull_request_review_id":4082285,"id":83226065,"diff_hunk":"@@ -388,27 +388,45 @@ function MdNavItem($$rAF) {\n     controllerAs: 'ctrl',\n     replace: true,\n     transclude: true,\n-    template:\n-      '<li class=\"md-nav-item\" role=\"option\" aria-selected=\"{{ctrl.isSelected()}}\">' +\n-        '<md-button ng-if=\"ctrl.mdNavSref\" class=\"_md-nav-button md-accent\"' +\n-          'ng-class=\"ctrl.getNgClassMap()\"' +\n-          'tabindex=\"-1\"' +\n-          'ui-sref=\"{{ctrl.mdNavSref}}\">' +\n-          '<span ng-transclude class=\"_md-nav-button-text\"></span>' +\n-        '</md-button>' +\n-        '<md-button ng-if=\"ctrl.mdNavHref\" class=\"_md-nav-button md-accent\"' +\n-          'ng-class=\"ctrl.getNgClassMap()\"' +\n-          'tabindex=\"-1\"' +\n-          'ng-href=\"{{ctrl.mdNavHref}}\">' +\n-          '<span ng-transclude class=\"_md-nav-button-text\"></span>' +\n-        '</md-button>' +\n-        '<md-button ng-if=\"ctrl.mdNavClick\" class=\"_md-nav-button md-accent\"' +\n-          'ng-class=\"ctrl.getNgClassMap()\"' +\n-          'tabindex=\"-1\"' +\n-          'ng-click=\"ctrl.mdNavClick()\">' +\n-          '<span ng-transclude class=\"_md-nav-button-text\"></span>' +\n-        '</md-button>' +\n-      '</li>',\n+    template: function(tElement, tAttrs) {\n+      var hasNavClick = tAttrs.mdNavClick;\n+      var hasNavHref = tAttrs.mdNavHref;\n+      var hasNavSref = tAttrs.mdNavSref;\n+\n+      // Cannot specify more than one nav attribute\n+      if ((hasNavClick ? 1:0) + (hasNavHref ? 1:0) + (hasNavSref ? 1:0) > 1) {\n+        throw Error(\n+          'Must specify exactly one of md-nav-click, md-nav-href, ' +\n+          'md-nav-sref for nav-item directive'\n+        );\n+      }\n+\n+      var navigationAttribute = '';","path":"src/components/navBar/navBar.js","position":38,"original_position":38,"commit_id":"2ee3f6ef293fb7508a1f5e38dd3e4da82f6069ed","original_commit_id":"2ee3f6ef293fb7508a1f5e38dd3e4da82f6069ed","user":{"login":"clshortfuse","id":9271155,"avatar_url":"https://avatars.githubusercontent.com/u/9271155?v=3","gravatar_id":"","url":"https://api.github.com/users/clshortfuse","html_url":"https://github.com/clshortfuse","followers_url":"https://api.github.com/users/clshortfuse/followers","following_url":"https://api.github.com/users/clshortfuse/following{/other_user}","gists_url":"https://api.github.com/users/clshortfuse/gists{/gist_id}","starred_url":"https://api.github.com/users/clshortfuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clshortfuse/subscriptions","organizations_url":"https://api.github.com/users/clshortfuse/orgs","repos_url":"https://api.github.com/users/clshortfuse/repos","events_url":"https://api.github.com/users/clshortfuse/events{/privacy}","received_events_url":"https://api.github.com/users/clshortfuse/received_events","type":"User","site_admin":false},"body":"You don't need to initialize this with a value.","created_at":"2016-10-13T14:16:56Z","updated_at":"2016-10-13T14:24:51Z","html_url":"https://github.com/angular/material/pull/9818#discussion_r83226065","pull_request_url":"https://api.github.com/repos/angular/material/pulls/9818","_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/comments/83226065"},"html":{"href":"https://github.com/angular/material/pull/9818#discussion_r83226065"},"pull_request":{"href":"https://api.github.com/repos/angular/material/pulls/9818"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/9818","id":88904937,"html_url":"https://github.com/angular/material/pull/9818","diff_url":"https://github.com/angular/material/pull/9818.diff","patch_url":"https://github.com/angular/material/pull/9818.patch","issue_url":"https://api.github.com/repos/angular/material/issues/9818","number":9818,"state":"open","locked":false,"title":"perf(navbar): reduces amount of watchers and buttons per item","user":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"body":"With the current approach, the navbar creates 3 child buttons and uses 3 `ng-if` statements to determine which one to render. This seems wasteful.\r\nThis PR moves that logic to the compilation phase which will only be triggered once (per occurrence in the DOM) and won't add any more watches.","created_at":"2016-10-11T20:28:54Z","updated_at":"2016-10-13T14:24:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfd0b0a0228e531d83e45bc3d0a6b7bc05d0ed87","assignee":{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false},"assignees":[{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/angular/material/pulls/9818/commits","review_comments_url":"https://api.github.com/repos/angular/material/pulls/9818/comments","review_comment_url":"https://api.github.com/repos/angular/material/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material/issues/9818/comments","statuses_url":"https://api.github.com/repos/angular/material/statuses/2ee3f6ef293fb7508a1f5e38dd3e4da82f6069ed","head":{"label":"crisbeto:navbar-bad-templating","ref":"navbar-bad-templating","sha":"2ee3f6ef293fb7508a1f5e38dd3e4da82f6069ed","user":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"repo":{"id":51659231,"name":"material","full_name":"crisbeto/material","owner":{"login":"crisbeto","id":4450522,"avatar_url":"https://avatars.githubusercontent.com/u/4450522?v=3","gravatar_id":"","url":"https://api.github.com/users/crisbeto","html_url":"https://github.com/crisbeto","followers_url":"https://api.github.com/users/crisbeto/followers","following_url":"https://api.github.com/users/crisbeto/following{/other_user}","gists_url":"https://api.github.com/users/crisbeto/gists{/gist_id}","starred_url":"https://api.github.com/users/crisbeto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crisbeto/subscriptions","organizations_url":"https://api.github.com/users/crisbeto/orgs","repos_url":"https://api.github.com/users/crisbeto/repos","events_url":"https://api.github.com/users/crisbeto/events{/privacy}","received_events_url":"https://api.github.com/users/crisbeto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crisbeto/material","description":"Material design for Angular","fork":true,"url":"https://api.github.com/repos/crisbeto/material","forks_url":"https://api.github.com/repos/crisbeto/material/forks","keys_url":"https://api.github.com/repos/crisbeto/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crisbeto/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crisbeto/material/teams","hooks_url":"https://api.github.com/repos/crisbeto/material/hooks","issue_events_url":"https://api.github.com/repos/crisbeto/material/issues/events{/number}","events_url":"https://api.github.com/repos/crisbeto/material/events","assignees_url":"https://api.github.com/repos/crisbeto/material/assignees{/user}","branches_url":"https://api.github.com/repos/crisbeto/material/branches{/branch}","tags_url":"https://api.github.com/repos/crisbeto/material/tags","blobs_url":"https://api.github.com/repos/crisbeto/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crisbeto/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crisbeto/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/crisbeto/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crisbeto/material/statuses/{sha}","languages_url":"https://api.github.com/repos/crisbeto/material/languages","stargazers_url":"https://api.github.com/repos/crisbeto/material/stargazers","contributors_url":"https://api.github.com/repos/crisbeto/material/contributors","subscribers_url":"https://api.github.com/repos/crisbeto/material/subscribers","subscription_url":"https://api.github.com/repos/crisbeto/material/subscription","commits_url":"https://api.github.com/repos/crisbeto/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/crisbeto/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/crisbeto/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/crisbeto/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/crisbeto/material/contents/{+path}","compare_url":"https://api.github.com/repos/crisbeto/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crisbeto/material/merges","archive_url":"https://api.github.com/repos/crisbeto/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crisbeto/material/downloads","issues_url":"https://api.github.com/repos/crisbeto/material/issues{/number}","pulls_url":"https://api.github.com/repos/crisbeto/material/pulls{/number}","milestones_url":"https://api.github.com/repos/crisbeto/material/milestones{/number}","notifications_url":"https://api.github.com/repos/crisbeto/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crisbeto/material/labels{/name}","releases_url":"https://api.github.com/repos/crisbeto/material/releases{/id}","deployments_url":"https://api.github.com/repos/crisbeto/material/deployments","created_at":"2016-02-13T18:29:24Z","updated_at":"2016-09-12T16:05:41Z","pushed_at":"2016-10-12T20:33:24Z","git_url":"git://github.com/crisbeto/material.git","ssh_url":"git@github.com:crisbeto/material.git","clone_url":"https://github.com/crisbeto/material.git","svn_url":"https://github.com/crisbeto/material","homepage":"https://material.angularjs.org/","size":44957,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"b14fa936c2aa8eaabd544a816e208b5ed326fce4","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":21399598,"name":"material","full_name":"angular/material","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/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","deployments_url":"https://api.github.com/repos/angular/material/deployments","created_at":"2014-07-01T19:20:06Z","updated_at":"2016-10-13T11:21:08Z","pushed_at":"2016-10-13T02:27:01Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":82513,"stargazers_count":14639,"watchers_count":14639,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3094,"mirror_url":null,"open_issues_count":374,"forks":3094,"open_issues":374,"watchers":14639,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/9818"},"html":{"href":"https://github.com/angular/material/pull/9818"},"issue":{"href":"https://api.github.com/repos/angular/material/issues/9818"},"comments":{"href":"https://api.github.com/repos/angular/material/issues/9818/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material/pulls/9818/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material/pulls/9818/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material/statuses/2ee3f6ef293fb7508a1f5e38dd3e4da82f6069ed"}}}}
{"actor":{"display_login":"clshortfuse"}}