fxHide or fxShow do not work in <ng-container>
See original GitHub issueBug Report
When using te directives fxHide or fxShow in a <ng-container> element inside a body template of a PrimeNG Table like this:
<table>
<tr *pTemplate="'body'" ...>
<td>...</td>
...
<ng-container fxHide.lt-md>
<td>...</td>
....
<td>...</td>
</ng-container>
</table>
The following error is shown:
ERROR TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Function.from (<anonymous>)
at DefaultShowHideDirective.ngAfterViewInit (show-hide.ts:70)
What is the expected behavior?
No error shown.
What is the current behavior?
The error is shown.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/core: 9.1.7 @angular/cdk: 9.2.4 @angular/flex-layout: 9.0.0-beta.31
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Content is not responsive in flex layout angular - Stack Overflow
First check all the required modules are added in module file then remove the parent div: <div fxFlexFill class="example-container">.
Read more >Angular Flex Layout: The Masquerade | by Aleix Suau - Medium
In this post I'll summarize the possibilities of flexbox and how Angular Flex Layout enrich and simplifies it with a cool declarative and...
Read more >How to export data table to pdf using angular material – iTecNote
I have tried to use jsPDF and I found that it works on static data and I want to take ... fxHide fxShow.gt-md>...
Read more >AngularJS - Bountysource
fxHide and fxShow hide elements via CSS display: none . While CSS-hiding is OK for simple HTML elements, it seems suboptimal for cases...
Read more >Video 4: Use fxLayout fxLayoutAlign fxFlex fxFlexOrder fxHide ...
... fxLayoutAlign, fxFlex, fxFlexOrder, fxHide and fxShow from Angular Flex Layout Support the ... Your browser can 't play this video....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not quite sure how flex-layout works under the hood, but it probably takes the directive and apply HTML markup based of it.
In the case of fxHide, it takes the element and sets
display:none
. ng-container in the other hand, as you said, don’t add a element to the DOM. There’s no element to add the styledisplay:none
from fxHide.Take a look at the example below, the same principe will be applyed.
IMO it’s not a bug, ng-container doesn’t get renderered in the html, so the directives won’t apply. Changing
ng-container
to adiv
will solve your problems. Obs: Same thing will happen if you specify a class or style in theng-container
.