{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/30938321","id":30938321,"diff_hunk":"@@ -0,0 +1,193 @@\n+import {ProtoViewRef, ViewRef, ViewContainerRef, ElementRef, onDestroy, NgFor, NgIf} from 'angular2/angular2';\n+\n+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';\n+import {View} from 'angular2/src/core/annotations_impl/view';\n+import {Parent} from 'angular2/src/core/annotations_impl/visibility';\n+import {Optional} from 'angular2/src/di/annotations_impl';\n+\n+import {ListWrapper} from 'angular2/src/facade/collection';\n+\n+\n+// TODO(jelbourn): ink bar animation.\n+// TODO(jelbourn): dynamic height mode\n+// TODO(jelbourn): tab pagination\n+// TODO(jelbourn): centering tabs\n+// TODO(jelbourn): stretching tabs\n+// TODO(jelbourn): disabled tabs\n+// TODO(jelbourn): default active tab\n+// TODO(jelbourn): focus wrapping\n+// TODO(jelbourn): onSelect / onDeselect events\n+// TODO(jelbourn): a11y attributes\n+// TODO(jelbourn): Content interface for MdTab, MdTabLabel, and MdTabContent\n+// TODO(jelbourn): Don't embed separate left and right background images.\n+\n+\n+/**\n+ * Component for `md-tabs`. Contains one or more `md-tab` elements.\n+ */\n+@Component({\n+  selector: 'md-tabs'\n+})\n+@View({\n+  templateUrl: 'angular2_material/src/components/tabs/tabs.html',\n+  directives: [MdTabViewContainer, NgFor, NgIf]\n+})\n+export class MdTabs {\n+  tabs: List<MdTab>;\n+  selectedTab: MdTab;\n+\n+  constructor() {\n+    this.tabs = [];\n+    this.selectedTab = null;\n+  }\n+\n+  /** Registers a child md-tab. */\n+  addTab(tab: MdTab) {\n+    ListWrapper.push(this.tabs, tab);\n+  }\n+\n+  /** Deregisters a child md-tab. */\n+  removeTab(tab: MdTab) {\n+    ListWrapper.remove(this.tabs, tab);\n+  }\n+\n+  /** Selects the given tab as active. */\n+  selectTab(tab: MdTab) {\n+    this.selectedTab = tab;\n+  }\n+}\n+\n+\n+/**\n+ * One tab inside of `md-tabs`.\n+ */\n+@Directive({\n+  selector: '[md-tab]',\n+  lifecycle: [onDestroy],\n+  properties: {\n+    'label': 'label'\n+  }\n+})\n+export class MdTab {\n+  // The ProtoView and ElementRef are stored in order to pass them to MdTabViewContainer\n+  // in cases when this `md-tab` does not contain an `md-tab-content`.\n+  protoViewRef: ProtoViewRef;\n+  elementRef: ElementRef;\n+\n+  /** The parent MdTabs group that this tab belongs to. */\n+  group: MdTabs;\n+\n+  /** The label for this tab. Mutually exclusive with `customLabel`. */\n+  label: string;\n+\n+  /** Child directive for custom label. */\n+  customLabel: MdTabLabel;\n+\n+  /** Child directive for content, used when a custom label is specified. */\n+  customContent: MdTabContent;\n+\n+  constructor(\n+      @Parent() tabGroup: MdTabs,\n+      @Optional() protoViewRef: ProtoViewRef,\n+      elementRef: ElementRef) {\n+    this.protoViewRef = protoViewRef;\n+    this.elementRef = elementRef;\n+\n+    this.customContent = null;\n+    this.customLabel = null;\n+    this.label = '';\n+\n+    this.group = tabGroup;\n+    tabGroup.addTab(this);\n+\n+    if (tabGroup.selectedTab == null) {\n+      tabGroup.selectedTab = this;\n+    }\n+  }\n+\n+  /**\n+   * Get the content for this MdTab, whethe it be directly inside the `md-tab` element or in\n+   * a child `md-tab-content` element.\n+   */\n+  get content() {\n+    return this.customContent != null ? this.customContent : this;","path":"modules/angular2_material/src/components/tabs/tabs.js","position":113,"original_position":113,"commit_id":"8cb98ea1b8bdd7b57895a4d5153bd4f0f155c869","original_commit_id":"8cb98ea1b8bdd7b57895a4d5153bd4f0f155c869","user":{"login":"rkirov","id":95713,"avatar_url":"https://avatars.githubusercontent.com/u/95713?v=3","gravatar_id":"","url":"https://api.github.com/users/rkirov","html_url":"https://github.com/rkirov","followers_url":"https://api.github.com/users/rkirov/followers","following_url":"https://api.github.com/users/rkirov/following{/other_user}","gists_url":"https://api.github.com/users/rkirov/gists{/gist_id}","starred_url":"https://api.github.com/users/rkirov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkirov/subscriptions","organizations_url":"https://api.github.com/users/rkirov/orgs","repos_url":"https://api.github.com/users/rkirov/repos","events_url":"https://api.github.com/users/rkirov/events{/privacy}","received_events_url":"https://api.github.com/users/rkirov/received_events","type":"User","site_admin":false},"body":"This is very odd the return type is `MdTabContent | MdTab`, can we specify (formally or in comments) the common interface both should implement.","created_at":"2015-05-22T23:41:20Z","updated_at":"2015-05-22T23:41:20Z","html_url":"https://github.com/angular/angular/pull/1977#discussion_r30938321","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/1977","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/30938321"},"html":{"href":"https://github.com/angular/angular/pull/1977#discussion_r30938321"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/1977"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/1977","id":35688844,"html_url":"https://github.com/angular/angular/pull/1977","diff_url":"https://github.com/angular/angular/pull/1977.diff","patch_url":"https://github.com/angular/angular/pull/1977.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/1977","number":1977,"state":"open","locked":false,"title":"feat(material): add prototype tabs component.","user":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"body":"Screenshot:\r\n![Screenshot of tabs](https://dl.dropboxusercontent.com/u/18203969/tabs.png)\r\n\r\nThis is very early and doesn't do any of the fancy animation or styling stuff.\r\n\r\nFYI @IgorMinar if you're curious how it came out after our brief paring. ","created_at":"2015-05-19T01:27:25Z","updated_at":"2015-05-22T23:41:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8b22888564800c8a761564e29556bb0dca1d10c","assignee":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular/pulls/1977/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/1977/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/1977/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/8cb98ea1b8bdd7b57895a4d5153bd4f0f155c869","head":{"label":"jelbourn:md-tabs","ref":"md-tabs","sha":"8cb98ea1b8bdd7b57895a4d5153bd4f0f155c869","user":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"repo":{"id":30261080,"name":"angular","full_name":"jelbourn/angular","owner":{"login":"jelbourn","id":838736,"avatar_url":"https://avatars.githubusercontent.com/u/838736?v=3","gravatar_id":"","url":"https://api.github.com/users/jelbourn","html_url":"https://github.com/jelbourn","followers_url":"https://api.github.com/users/jelbourn/followers","following_url":"https://api.github.com/users/jelbourn/following{/other_user}","gists_url":"https://api.github.com/users/jelbourn/gists{/gist_id}","starred_url":"https://api.github.com/users/jelbourn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jelbourn/subscriptions","organizations_url":"https://api.github.com/users/jelbourn/orgs","repos_url":"https://api.github.com/users/jelbourn/repos","events_url":"https://api.github.com/users/jelbourn/events{/privacy}","received_events_url":"https://api.github.com/users/jelbourn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jelbourn/angular","description":"","fork":true,"url":"https://api.github.com/repos/jelbourn/angular","forks_url":"https://api.github.com/repos/jelbourn/angular/forks","keys_url":"https://api.github.com/repos/jelbourn/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jelbourn/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jelbourn/angular/teams","hooks_url":"https://api.github.com/repos/jelbourn/angular/hooks","issue_events_url":"https://api.github.com/repos/jelbourn/angular/issues/events{/number}","events_url":"https://api.github.com/repos/jelbourn/angular/events","assignees_url":"https://api.github.com/repos/jelbourn/angular/assignees{/user}","branches_url":"https://api.github.com/repos/jelbourn/angular/branches{/branch}","tags_url":"https://api.github.com/repos/jelbourn/angular/tags","blobs_url":"https://api.github.com/repos/jelbourn/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jelbourn/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jelbourn/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/jelbourn/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jelbourn/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/jelbourn/angular/languages","stargazers_url":"https://api.github.com/repos/jelbourn/angular/stargazers","contributors_url":"https://api.github.com/repos/jelbourn/angular/contributors","subscribers_url":"https://api.github.com/repos/jelbourn/angular/subscribers","subscription_url":"https://api.github.com/repos/jelbourn/angular/subscription","commits_url":"https://api.github.com/repos/jelbourn/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/jelbourn/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/jelbourn/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/jelbourn/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/jelbourn/angular/contents/{+path}","compare_url":"https://api.github.com/repos/jelbourn/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jelbourn/angular/merges","archive_url":"https://api.github.com/repos/jelbourn/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jelbourn/angular/downloads","issues_url":"https://api.github.com/repos/jelbourn/angular/issues{/number}","pulls_url":"https://api.github.com/repos/jelbourn/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/jelbourn/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/jelbourn/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jelbourn/angular/labels{/name}","releases_url":"https://api.github.com/repos/jelbourn/angular/releases{/id}","created_at":"2015-02-03T19:44:21Z","updated_at":"2015-05-05T18:36:57Z","pushed_at":"2015-05-19T16:52:50Z","git_url":"git://github.com/jelbourn/angular.git","ssh_url":"git@github.com:jelbourn/angular.git","clone_url":"https://github.com/jelbourn/angular.git","svn_url":"https://github.com/jelbourn/angular","homepage":null,"size":6783,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"cd7aef2139e715c7a0a91983fc9203fc9471957a","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":24195339,"name":"angular","full_name":"angular/angular","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","description":"","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","created_at":"2014-09-18T16:12:01Z","updated_at":"2015-05-22T22:42:22Z","pushed_at":"2015-05-22T23:21:09Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":null,"size":29405,"stargazers_count":3183,"watchers_count":3183,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":812,"mirror_url":null,"open_issues_count":381,"forks":812,"open_issues":381,"watchers":3183,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/1977"},"html":{"href":"https://github.com/angular/angular/pull/1977"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/1977"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/1977/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/1977/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/1977/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/8cb98ea1b8bdd7b57895a4d5153bd4f0f155c869"}}}}