ng-container display issue
See original GitHub issueI’m submitting a … (check one with “x”)
[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Nesting ng-container in a transclusion results in the following error:
TypeError: Cannot read property ‘display’ of undefined at BaseFxDirectiveAdapter.BaseFxDirective._getDisplayStyle …
Expected behavior
The ng-container would render its contents.
Minimal reproduction of the problem with instructions Nest ng-container in a component that supports transclusion, like so:
<user-form [user]="user" (submitted)="submitted($event)"> <ng-container class="additional-actions"> <button md-raised-button> Button One </button> <button md-raised-button> Button Two </button> </ng-container> </user-form>
It should be noted that the individual buttons can implement the “additional-actions” class directly, and the html will render without error:
<user-form [user]="user" (submitted)="submitted($event)"> <button class="additional-actions" md-raised-button> Button One </button> <button class="additional-actions" md-raised-button> Button Two </button> </user-form>
What is the motivation / use case for changing the behavior? Allow ng-container to render child content in a transclusion.
Please tell us about your environment: @angular/cli: 1.0.0 node: 6.10.0 os: win32 x64 @angular/animations: 4.0.1 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/flex-layout: 2.0.0-rc.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/material: 2.0.0-beta.3 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.1
-
Browser: Chrome, Version 57.0.2987.133 (64-bit)
-
Language: Typescript 2.2.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)

Top Related StackOverflow Question
If you put
<tr>insideng-containerit will not work 😦https://plnkr.co/edit/xRuoiILaPtSliQ8KEGCB
PS: Seems related to #18314?
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.