{"action":"created","issue":{"url":"https://api.github.com/repos/angular/material2/issues/5927","repository_url":"https://api.github.com/repos/angular/material2","labels_url":"https://api.github.com/repos/angular/material2/issues/5927/labels{/name}","comments_url":"https://api.github.com/repos/angular/material2/issues/5927/comments","events_url":"https://api.github.com/repos/angular/material2/issues/5927/events","html_url":"https://github.com/angular/material2/issues/5927","id":244558386,"number":5927,"title":"[Table] Add example with dynamic columns","user":{"login":"rafaelss95","id":11965907,"avatar_url":"https://avatars0.githubusercontent.com/u/11965907?v=4","gravatar_id":"","url":"https://api.github.com/users/rafaelss95","html_url":"https://github.com/rafaelss95","followers_url":"https://api.github.com/users/rafaelss95/followers","following_url":"https://api.github.com/users/rafaelss95/following{/other_user}","gists_url":"https://api.github.com/users/rafaelss95/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelss95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelss95/subscriptions","organizations_url":"https://api.github.com/users/rafaelss95/orgs","repos_url":"https://api.github.com/users/rafaelss95/repos","events_url":"https://api.github.com/users/rafaelss95/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelss95/received_events","type":"User","site_admin":false},"labels":[{"id":618683764,"url":"https://api.github.com/repos/angular/material2/labels/P4:%20minor","name":"P4: minor","color":"fef2c0","default":false},{"id":311424271,"url":"https://api.github.com/repos/angular/material2/labels/docs","name":"docs","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"andrewseguin","id":22898577,"avatar_url":"https://avatars3.githubusercontent.com/u/22898577?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewseguin","html_url":"https://github.com/andrewseguin","followers_url":"https://api.github.com/users/andrewseguin/followers","following_url":"https://api.github.com/users/andrewseguin/following{/other_user}","gists_url":"https://api.github.com/users/andrewseguin/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewseguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewseguin/subscriptions","organizations_url":"https://api.github.com/users/andrewseguin/orgs","repos_url":"https://api.github.com/users/andrewseguin/repos","events_url":"https://api.github.com/users/andrewseguin/events{/privacy}","received_events_url":"https://api.github.com/users/andrewseguin/received_events","type":"User","site_admin":false},"assignees":[{"login":"andrewseguin","id":22898577,"avatar_url":"https://avatars3.githubusercontent.com/u/22898577?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewseguin","html_url":"https://github.com/andrewseguin","followers_url":"https://api.github.com/users/andrewseguin/followers","following_url":"https://api.github.com/users/andrewseguin/following{/other_user}","gists_url":"https://api.github.com/users/andrewseguin/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewseguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewseguin/subscriptions","organizations_url":"https://api.github.com/users/andrewseguin/orgs","repos_url":"https://api.github.com/users/andrewseguin/repos","events_url":"https://api.github.com/users/andrewseguin/events{/privacy}","received_events_url":"https://api.github.com/users/andrewseguin/received_events","type":"User","site_admin":false}],"milestone":null,"comments":17,"created_at":"2017-07-21T04:00:33Z","updated_at":"2018-03-09T16:27:41Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"#### Bug, feature request, or proposal:\r\nProposal\r\n\r\n#### What is the expected behavior?\r\nIt'd be nice to have example(s) on how to use `md-table` with dynamic columns.\r\n\r\n#### What is the current behavior?\r\nCurrently all the examples are with hard coded columns, like this:\r\n\r\n```\r\n<!-- ID Column -->\r\n<ng-container cdkColumnDef=\"userId\">\r\n  <md-header-cell *cdkHeaderCellDef md-sort-header> ID </md-header-cell>\r\n  <md-cell *cdkCellDef=\"let row\"> {{row.id}} </md-cell>\r\n</ng-container>\r\n\r\n<!-- Progress Column -->\r\n<ng-container cdkColumnDef=\"progress\">\r\n  <md-header-cell *cdkHeaderCellDef md-sort-header> Progress </md-header-cell>\r\n  <md-cell *cdkCellDef=\"let row\"> {{row.progress}}% </md-cell>\r\n</ng-container>\r\n```\r\n\r\n@andrewseguin "},"comment":{"url":"https://api.github.com/repos/angular/material2/issues/comments/371863077","html_url":"https://github.com/angular/material2/issues/5927#issuecomment-371863077","issue_url":"https://api.github.com/repos/angular/material2/issues/5927","id":371863077,"user":{"login":"nothingisnecessary","id":5988381,"avatar_url":"https://avatars2.githubusercontent.com/u/5988381?v=4","gravatar_id":"","url":"https://api.github.com/users/nothingisnecessary","html_url":"https://github.com/nothingisnecessary","followers_url":"https://api.github.com/users/nothingisnecessary/followers","following_url":"https://api.github.com/users/nothingisnecessary/following{/other_user}","gists_url":"https://api.github.com/users/nothingisnecessary/gists{/gist_id}","starred_url":"https://api.github.com/users/nothingisnecessary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nothingisnecessary/subscriptions","organizations_url":"https://api.github.com/users/nothingisnecessary/orgs","repos_url":"https://api.github.com/users/nothingisnecessary/repos","events_url":"https://api.github.com/users/nothingisnecessary/events{/privacy}","received_events_url":"https://api.github.com/users/nothingisnecessary/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T16:27:41Z","updated_at":"2018-03-09T16:27:41Z","author_association":"NONE","body":"@boombard I tried different property bindings and I couldn't get it to work. I found that if you add \"disabled\" attribute it disables it, but other than using *ngIf I didn't find a way to conditionally emit the disabled attribute.\r\n\r\nConditionally sortable columns (works fine a dynamic column loop too)\r\n\r\n      <div *ngIf=\"sortable\">\r\n      <mat-header-cell *matHeaderCellDef mat-sort-header> No. </mat-header-cell>\r\n      </div>\r\n      <div *ngIf=\"!sortable\">\r\n        <mat-header-cell *matHeaderCellDef mat-sort-header disabled> No. </mat-header-cell>\r\n      </div>\r\n\r\n"}}
{"actor":{"display_login":"nothingisnecessary"}}