Skip to content
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

multiTemplateDataRows property not working when ivy is enabled #16044

Closed
Hendrik212 opened this issue May 17, 2019 · 2 comments · Fixed by #16047
Closed

multiTemplateDataRows property not working when ivy is enabled #16044

Hendrik212 opened this issue May 17, 2019 · 2 comments · Fixed by #16047
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@Hendrik212
Copy link

What is the expected behavior?

No error

What is the current behavior?

Property multiTemplateDataRows fails when ivy is enabled with the following errors:
ng serve:

ERROR TypeError: Cannot read property 'viewContainer' of undefined at MatTable.set multiTemplateDataRows [as multiTemplateDataRows] (table.js:1328) at setInputsFromAttrs (core.js:12995) at postProcessDirective (core.js:12784) at instantiateAllDirectives (core.js:12678) at createDirectivesAndLocals (core.js:12097) at ΔelementStart (core.js:15361) at AppComponent_Template (template.html:1) at executeTemplate (core.js:12019) at checkView (core.js:13370) at componentRefresh (core.js:13134)

What are the steps to reproduce?

  1. ng new myApp --enable-ivy
  2. cd myApp
  3. ng add @angular/material@next
  4. use code from Angular Material Docs Example "Table with expandable rows" Stackblitz link

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

I am using the latest release candidates of angular 8:

Angular CLI: 8.0.0-rc.4
Node: 10.13.0
OS: win32 x64
Angular: 8.0.0-rc.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.800.0-rc.4
@angular-devkit/build-angular 0.800.0-rc.4
@angular-devkit/build-optimizer 0.800.0-rc.4
@angular-devkit/build-webpack 0.800.0-rc.4
@angular-devkit/core 8.0.0-rc.4
@angular-devkit/schematics 8.0.0-rc.4
@angular/cdk 8.0.0-rc.1
@angular/material 8.0.0-rc.1
@ngtools/webpack 8.0.0-rc.4
@schematics/angular 8.0.0-rc.4
@schematics/update 0.800.0-rc.4
rxjs 6.4.0
typescript 3.4.5
webpack 4.30.0

Is there anything else we should know?

The viewChild "_rowOutlet" seems to be undefined when the following function is called in table.js, leading to the error:

set multiTemplateDataRows(v) { this._multiTemplateDataRows = coerceBooleanProperty(v); if (this._rowOutlet.viewContainer.length) { this._forceRenderDataRows(); } }

If I remove the multiTemplateDataRows property and the second detail row in the example, the table renders correctly but without the expanding rows functionality.

@crisbeto crisbeto self-assigned this May 17, 2019
@crisbeto crisbeto added has pr P2 The issue is important to a large percentage of users, with a workaround labels May 17, 2019
crisbeto added a commit to crisbeto/material2 that referenced this issue May 17, 2019
Fixes an error that is thrown by the table in Ivy, if `multiTemplateDataRows` is set as a static attribute. The timing for static attributes is slightly different in Ivy, which means that we need an extra null check.

Fixes angular#16044.
@jloosli
Copy link

jloosli commented May 17, 2019

Until the fix is pushed out, I was able to get around this by changing

<table multiTemplateDataRows>

to

<table [multiTemplateDataRows]='true'>

mmalerba pushed a commit that referenced this issue May 21, 2019
Fixes an error that is thrown by the table in Ivy, if `multiTemplateDataRows` is set as a static attribute. The timing for static attributes is slightly different in Ivy, which means that we need an extra null check.

Fixes #16044.
mmalerba pushed a commit that referenced this issue May 21, 2019
Fixes an error that is thrown by the table in Ivy, if `multiTemplateDataRows` is set as a static attribute. The timing for static attributes is slightly different in Ivy, which means that we need an extra null check.

Fixes #16044.
RudolfFrederiksen pushed a commit to RudolfFrederiksen/material2 that referenced this issue Jun 21, 2019
…6047)

Fixes an error that is thrown by the table in Ivy, if `multiTemplateDataRows` is set as a static attribute. The timing for static attributes is slightly different in Ivy, which means that we need an extra null check.

Fixes angular#16044.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants