-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: ng-generateSchematics that generate code in user projectsSchematics that generate code in user projects
Description
Reproduction
Steps to reproduce:
ng newwith strict mode onng add @angular/materialng g @angular/material:table tablenpm start
Expected Behavior
What behavior were you expecting to see?
The app should build and work.
Actual Behavior
What behavior did you actually see?
Error: src/app/table/table-datasource.ts:44:3 - error TS2564: Property 'paginator' has no initializer and is not definitely assigned in the constructor.
44 paginator: MatPaginator;
~~~~~~~~~
Error: src/app/table/table-datasource.ts:45:3 - error TS2564: Property 'sort' has no initializer and is not definitely assigned in the constructor.
45 sort: MatSort;
~~~~
Error: src/app/table/table.component.ts:13:28 - error TS2564: Property 'paginator' has no initializer and is not definitely assigned in the constructor.
13 @ViewChild(MatPaginator) paginator: MatPaginator;
~~~~~~~~~
Error: src/app/table/table.component.ts:14:23 - error TS2564: Property 'sort' has no initializer and is not definitely assigned in the constructor.
14 @ViewChild(MatSort) sort: MatSort;
~~~~
Error: src/app/table/table.component.ts:15:24 - error TS2564: Property 'table' has no initializer and is not definitely assigned in the constructor.
[39m[0m
15 @ViewChild(MatTable) table: MatTable<TableItem>;
~~~~~
Error: src/app/table/table.component.ts:16:3 - error TS2564: Property 'dataSource' has no initializer and is not definitely assigned in the constructor.
16 dataSource: TableDataSource;
~~~~~~~~~~
Error: src/app/table/table.component.html:20:34 - error TS2532: Object is possibly 'undefined'.
20 [length]="dataSource?.data.length"
~~~~~~
src/app/table/table.component.ts:9:16
9 templateUrl: './table.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component TableComponent.Environment
- Angular: 11.2.1
- CDK/Material: 11.2.1
- Browser(s): N/A
- Operating System (e.g. Windows, macOS, Ubuntu): macOS Catalina
Relates to #17135
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: ng-generateSchematics that generate code in user projectsSchematics that generate code in user projects