-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(table): add example using http #5766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
} | ||
|
||
export interface MyGithubIssue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just GithubIssue
?
} | ||
|
||
/** An example database that the data source uses to retrieve data for the table. */ | ||
export class ExampleHttpDatabase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExampleHttpDao
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExampleService ?
return this.http.get(this.issuesUrl).map(this.extractData); | ||
} | ||
|
||
extractData(result: Response): MyGithubIssue[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this private?
return this.http.get(this.issuesUrl).map(this.extractData); | ||
} | ||
|
||
extractData(result: Response): MyGithubIssue[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe readGthubResult
?
Ready for review again |
Is it possible to add some features like sorting, pagination, filters on this example ? Cause if we take source of others examples:
This case could not work cause you return an Observable of Observable. Thx. |
@christophe-mailfert in that case you would want to use Maybe once the table overview is available in the docs, it'll be clearer how combining features should work (see unpublished example). |
font-size: 20px; | ||
} | ||
|
||
.mat-table { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these classes need to be under an .example-
prefix
} | ||
|
||
/** An example database that the data source uses to retrieve data for the table. */ | ||
export class ExampleHttpDao { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should include sorting and pagination in this example. The github api supports it.
@andrewseguin Where is |
@ctilley83 I updated the plunker, |
@andrewseguin I don't think your update saved. Was there a new link? |
Seems updated to me, perhaps it was a caching issue. I forked the code regardless and created a new URL. Can you see if that works |
Added sorting and pagination to the example, updated the plunker example with the latest version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The plunker is showing a changed after checked error. Also the programmatic resetting of pageIndex is experiencing same issue as described in #5904 |
I think the example module needs to be regenerated |
@kara @andrewseguin merging this broke the e2e tests. |
@andrewseguin and @willshowell the plunker example implements sorting also in server side. Can you please help me with this? Below is the sample connect() implementation
|
Not sure if has something wrong on my side but looks like it is not working. It is not even trying to fetch the data. |
The one thing I don't like about the example is how it mixes code pieces which shouldn't be mixed in my opinion. The DataSource feels like a very abstract class which should be concerned about handling data. It should not have any knowledge about Components. Other than that, great example and thanks for this! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Here's a live example of this in plunker: https://plnkr.co/edit/VAvjp7t5jqtUKfHv4ogM?p=preview
Will need to add this example to the
Examples
tab in material.angular.ioFixes #5670