-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(COMPONENT): Make DataSource<T> an interface #21887
Comments
Changing it at this point would be breaking. For what it's worth, TypeScript allows you to implement classes as well. E.g. you should be able to do |
Thanks for the lightning-fast response! Yeah I get that it's a breaking change, maybe not worth it at this point in time. Perhaps just for consideration if you guys ever revamp Table Datasources. Thanks for the tip about implementing the DataSource instead of extending it, that worked just fine for me. That tidbit could be helpful for addition to the docs, what do you think? I'd be happy to submit a quick PR for the docs update. |
Sure, feel free to send out a PR and I can review it. |
docs(table): additional details on table data sources Provides additional documentation and clarification on extending the base DataSource class with custom data sources either by extending or implementing. Fixes angular#21887
Provides additional documentation and clarification on extending the base DataSource class with custom data sources either by extending or implementing. Fixes #21887 * docs(material/table) removing backticks around "extending"
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. |
Feature Description
Instead of an entirely abstract class (see https://github.com/angular/components/blob/master/src/cdk/collections/data-source.ts), why not make it an interface?
Use Case
This would enable users such as myself to create custom data sources that extend other classes. With DataSource being an abstract class, it means I have to extend that to make a custom DataSource and therefore cannot extend any other class with my custom DataSource. My use case is that i have a logging base class, and want to extend it in a new class to also act as a custom Data Source.
The text was updated successfully, but these errors were encountered: