Skip to content

Commit 045af6f

Browse files
AlexElinannieyw
authored andcommitted
docs: monospace DataSource (table docs) (#22114)
(cherry picked from commit 0950cd5)
1 parent 766c9ea commit 045af6f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/material/table/table.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,21 @@ automatically trigger an update to the rows each time a new data array is emitte
106106

107107
#### DataSource
108108

109-
For most real-world applications, providing the table a DataSource instance will be the best way to
110-
manage data. The DataSource is meant to serve as a place to encapsulate any sorting, filtering,
109+
For most real-world applications, providing the table a `DataSource` instance will be the best way to
110+
manage data. The `DataSource` is meant to serve as a place to encapsulate any sorting, filtering,
111111
pagination, and data retrieval logic specific to the application.
112112

113-
A DataSource is simply a class that has at a minimum the following methods: `connect` and
114-
`disconnect`. The `connect` method will be called by the table to provide an Observable that emits
113+
A `DataSource` is simply a class that has at a minimum the following methods: `connect` and
114+
`disconnect`. The `connect` method will be called by the table to provide an `Observable` that emits
115115
the data array that should be rendered. The table will call `disconnect` when the table is destroyed,
116116
which may be the right time to clean up any subscriptions that may have been registered in the
117117
`connect` method.
118118

119-
Although Angular Material provides a ready-made table DataSource class, `MatTableDataSource`, you may
120-
want to create your own custom DataSource class for more complex use cases. This can be done by
121-
extending the abstract DataSource class with a custom DataSource class that then implements the
122-
`connect` and `disconnect` methods. For use cases where the custom DataSource must also inherit
123-
functionality by extending a different base class, the DataSource base class can be
119+
Although Angular Material provides a ready-made table `DataSource` class, `MatTableDataSource`, you may
120+
want to create your own custom `DataSource` class for more complex use cases. This can be done by
121+
extending the abstract `DataSource` class with a custom `DataSource` class that then implements the
122+
`connect` and `disconnect` methods. For use cases where the custom `DataSource` must also inherit
123+
functionality by extending a different base class, the `DataSource` base class can be
124124
implemented instead (`MyCustomDataSource extends SomeOtherBaseClass implements DataSource`) to
125125
respect Typescript's restriction to only implement one base class.
126126

0 commit comments

Comments
 (0)