Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

DevTools does not show component tree when injecting ViewContainerRef in AppComponent #824

Closed
decline opened this issue May 27, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@decline
Copy link

decline commented May 27, 2021

Angular DevTools version (required): 1.0.1

Angular version (required): 11.2.14

Link to a minimal GitHub repository: https://github.com/decline/angular-devtools-issue

Description of issue:

When injecting the ViewContainerRef in the AppComponent construct, Angular DevTools will not work.

To make it work again, remove this construct from the AppComponent:

  constructor(public viewContainerRef: ViewContainerRef) {
    this.hasViewContainerRef = !!viewContainerRef;
  }

Steps to reproduce:

  1. Checkout GitHub repository, run npm install and serve app with ng serve

  2. Open the app in the browser and start DevTools (you should not see the component tree in DevTools):

Screen Shot 2021-05-27 at 12 10 34

  1. In AppComponent just remove the construct. DevTools should now show the component tree:

Screen Shot 2021-05-27 at 12 10 52

@decline decline added the bug Something isn't working label May 27, 2021
@mgechev
Copy link
Contributor

mgechev commented May 27, 2021

Duplicate of #773 and #809. The easiest fix would be to update to v12.

@mgechev mgechev closed this as completed May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants