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

4.0.0-rc.6 regression: using @Input() @ContentChild() on the same property breaks input #15417

Closed
pkozlowski-opensource opened this issue Mar 23, 2017 · 1 comment · Fixed by #15429
Labels
area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version type: bug/fix

Comments

@pkozlowski-opensource
Copy link
Member

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting

Current behavior

Given the property that has both @input() and @ContentChild() annotations breaks the @input(). Ex.: @Input() @ContentChild(TemplateRef) tpl: TemplateRef<any>;

Expected behavior

Using @Input() and @ContentChild() on the same element should be supported as it used to be in 2.x or clearly documented as not supported.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/2jmrDYD7yEV62YaQ848y?p=preview

Observed behaviour: prints: "default, Custom as a child, default"

Expected behaviour: prints: "default, Custom as a child, Custom as a binding"

What is the motivation / use case for changing the behavior?

In ng-bootstrap we've got the API that let's users provide a custom rating template either as a binding or as a child template: https://github.com/ng-bootstrap/ng-bootstrap/blob/5856a75ace90c7323d073f1a9838560016bbb5d4/src/rating/rating.ts#L96

Besides it is a regression, you can confirm that it used to work by changing ANgular version in the config.js file in the linked plunker.

  • Angular version: 4.0.0-rc.6, used to work in 2.4.10
@pkozlowski-opensource pkozlowski-opensource added area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version type: bug/fix labels Mar 23, 2017
@tbosch tbosch self-assigned this Mar 23, 2017
@IgorMinar IgorMinar added this to the 4.0.0-blockers milestone Mar 23, 2017
tbosch added a commit to tbosch/angular that referenced this issue Mar 23, 2017
This has the side effect of allowing `@Input` and `@ContentChild`
on the same property if the query is static (see the bug description
for details).

Fixes angular#15417
vicb pushed a commit that referenced this issue Mar 23, 2017
This has the side effect of allowing `@Input` and `@ContentChild`
on the same property if the query is static (see the bug description
for details).

Fixes #15417
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
This has the side effect of allowing `@Input` and `@ContentChild`
on the same property if the query is static (see the bug description
for details).

Fixes angular#15417
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
This has the side effect of allowing `@Input` and `@ContentChild`
on the same property if the query is static (see the bug description
for details).

Fixes angular#15417
@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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants