Skip to content

Allow read of ChangeDetectorRef in queries #34347

@waterplea

Description

@waterplea

🐞 bug report

Affected Package

The issue is caused by package @angular/core

Is this a regression?

I don't think so, tested on Angular 7 and 8

Description

Through `read` option of `ViewChild` we are able to retrieve services from Injector, for example if we add some service to our component's providers, we can read it. We can also read `ElementRef`, for example. However, we cannot retrieve `ChangeDetecotrRef`. We are getting undefined.

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-read-cdr

🌍 Your Environment

Angular Version:

8

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecore: queriesdesign complexity: low-hangingfeatureLabel used to distinguish feature request from other issuesfeature: under considerationFeature request for which voting has completed and the request is now under consideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions