Skip to content

Commit

Permalink
fix(material/schematics): support stricter TypeScript compiler flags
Browse files Browse the repository at this point in the history
Fixes #17135
  • Loading branch information
Splaktar committed Sep 20, 2019
1 parent f537fba commit fb3a473
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ export class <%= classify(name) %>DataSource extends DataSource<<%= classify(nam
}

/** Simple sort comparator for example ID/Name columns (for client-side sorting). */
function compare(a, b, isAsc) {
function compare(a: any, b: any, isAsc: boolean) {
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component<% if (!!viewEncapsulation) { %>, ViewEncapsulation<% }%><% if (changeDetection !== 'Default') { %>, ChangeDetectionStrategy<% }%> } from '@angular/core';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { of as observableOf } from 'rxjs';
import { FlatTreeControl } from '@angular/cdk/tree';
import { files } from './example-data';

Expand Down Expand Up @@ -84,7 +83,10 @@ export class <%= classify(name) %>Component {
}

/** Get the children for the node. */
getChildren(node: FileNode) {
return observableOf(node.children);
getChildren(node: FileNode): FileNode[] | null | undefined {
if (node.children === null || node.children === undefined) {
return node.children;
}
return node.children;
}
}

0 comments on commit fb3a473

Please sign in to comment.