Skip to content

schematic(table): Cannot read property 'data' of undefined #15788

Closed
@b-mi

Description

@b-mi

What is the expected behavior?

Do not work, ends with error "Cannot read property 'data' of undefined"

What is the current behavior?

Without error

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

Bad generated code:

  ngAfterViewInit() {
    this.dataSource = new InfoOProgDataSource(this.paginator, this.sort);
  }

Correct code:
  ngOnInit() {
    this.dataSource = new InfoOProgDataSource(this.paginator, this.sort);
  }

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Updated angular, material 7.3.7

Is there anything else we should know?

Better testing?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions