New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schematic(table): Cannot read property 'data' of undefined #15788
Comments
Do you have a full stack trace to share? |
OK, I was able to reproduce this: ERROR TypeError: Cannot read property 'data' of undefined
at TableComponent_Template (template.html:20)
at checkView (core.js:8963)
at componentRefresh (core.js:8772)
at refreshChildComponents (core.js:7896)
at refreshDescendantViews (core.js:7836)
at checkView (core.js:8964)
at componentRefresh (core.js:8772)
at refreshChildComponents (core.js:7896)
at refreshDescendantViews (core.js:7836)
at renderComponentOrTemplate (core.js:8099) |
Issue can be fixed by using Angular's safe navigation operator when accessing the Right now the |
fix exception when instantiating MatPaginator before dataSource defined fix ExpressionChangedAfterItHasBeenCheckedError caused by above - first initialize the template w/o dataSource & w/ a sort and paginator - then get the references to the template's MatSort and MatPaginator - then set the data source's sort and paginator - then set the table's data source from the component Fixes #15788
fix exception when instantiating MatPaginator before dataSource defined fix ExpressionChangedAfterItHasBeenCheckedError caused by above - first initialize the template w/o dataSource & w/ a sort and paginator - then get the references to the template's MatSort and MatPaginator - then set the data source's sort and paginator - then set the table's data source from the component Fixes #15788
fix exception when instantiating MatPaginator before dataSource defined fix ExpressionChangedAfterItHasBeenCheckedError caused by above - first initialize the template w/o dataSource & w/ a sort and paginator - then get the references to the template's MatSort and MatPaginator - then set the data source's sort and paginator - then set the table's data source from the component Fixes #15788
…r#15800) fix exception when instantiating MatPaginator before dataSource defined fix ExpressionChangedAfterItHasBeenCheckedError caused by above - first initialize the template w/o dataSource & w/ a sort and paginator - then get the references to the template's MatSort and MatPaginator - then set the data source's sort and paginator - then set the table's data source from the component Fixes angular#15788
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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:
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?
The text was updated successfully, but these errors were encountered: