Skip to content

Commit f32fb68

Browse files
Splaktarjelbourn
authored andcommitted
fix(material/schematics): support stricter TypeScript compiler flags (#17159)
Fixes #17135
1 parent 7464d4b commit f32fb68

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/material/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__-datasource.ts.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ export class <%= classify(name) %>DataSource extends DataSource<<%= classify(nam
103103
}
104104

105105
/** Simple sort comparator for example ID/Name columns (for client-side sorting). */
106-
function compare(a, b, isAsc) {
106+
function compare(a: string | number, b: string | number, isAsc: boolean) {
107107
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
108108
}

src/material/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component<% if (!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if (changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
22
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
3-
import { of as observableOf } from 'rxjs';
43
import { FlatTreeControl } from '@angular/cdk/tree';
54
import { files } from './example-data';
65

@@ -84,7 +83,7 @@ export class <%= classify(name) %>Component {
8483
}
8584

8685
/** Get the children for the node. */
87-
getChildren(node: FileNode) {
88-
return observableOf(node.children);
86+
getChildren(node: FileNode): FileNode[] | null | undefined {
87+
return node.children;
8988
}
9089
}

0 commit comments

Comments
 (0)