Skip to content

[Table] MatTableDataSource constructor should include MatSort, MatPaginator #8520

@JaxonWright

Description

@JaxonWright

Bug, feature request, or proposal:

feature request

What is the expected behavior?

Have a constructor that, at least optionally, takes a MatSort and/or a MatPaginator as parameters.

What is the current behavior?

Currently, you have to create a new MatTableDataSource with only data as a parameter. However, you always have to set the matSort and paginator of the MatTableDataSource after construction. I had to make a class that extends this class to have this, which seems superfluous.

What are the steps to reproduce?

What is the use-case or motivation for changing an existing behavior?

To make the creation of MatTableDataSources easier.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 5.0.1
Material: 5.0.0-rc0
OS: Windows 10 Pro
TypeScript: 2.6.1
Browser: Google Chrome 62.0.3202.94 (Official Build) (64-bit)

Is there anything else we should know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tablefeatureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions