Skip to content

Commit 2d407a2

Browse files
crisbetojelbourn
authored andcommitted
docs(tree): injectable decorator set on wrong class (#17843)
Fixes the `Injectable` decorator being set on the wrong class in one of the tree examples. This hasn't broken until now because that class isn't using DI anyway. Fixes #17815.
1 parent 04d9459 commit 2d407a2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components-examples/material/tree/tree-dynamic/tree-dynamic-example.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class DynamicFlatNode {
1414
* Database for dynamic data. When expanding a node in the tree, the data source will need to fetch
1515
* the descendants data from the database.
1616
*/
17+
@Injectable({providedIn: 'root'})
1718
export class DynamicDatabase {
1819
dataMap = new Map<string, string[]>([
1920
['Fruits', ['Apple', 'Orange', 'Banana']],
@@ -44,7 +45,6 @@ export class DynamicDatabase {
4445
* The input will be a json object string, and the output is a list of `FileNode` with nested
4546
* structure.
4647
*/
47-
@Injectable()
4848
export class DynamicDataSource implements DataSource<DynamicFlatNode> {
4949

5050
dataChange = new BehaviorSubject<DynamicFlatNode[]>([]);
@@ -118,8 +118,7 @@ export class DynamicDataSource implements DataSource<DynamicFlatNode> {
118118
@Component({
119119
selector: 'tree-dynamic-example',
120120
templateUrl: 'tree-dynamic-example.html',
121-
styleUrls: ['tree-dynamic-example.css'],
122-
providers: [DynamicDatabase]
121+
styleUrls: ['tree-dynamic-example.css']
123122
})
124123
export class TreeDynamicExample {
125124
constructor(database: DynamicDatabase) {

0 commit comments

Comments
 (0)