-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimebug
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Had reported in #41801, but with insufficient detail.
For, using forwardRef for NgModule.declarations doesn't work.
import { CommonModule } from '@angular/common';
import { Component, forwardRef, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
@Component({
selector: 'app-root',
template: `
<button type="button" (click)="on = !on">Toggle</button>
<ng-container *ngIf="on">
On
</ng-container>
<ng-container *ngIf="!on">
Off
</ng-container>
`
})
export class AppComponent {
on = false;
}
@NgModule({
bootstrap: [forwardRef(() => AppComponent)],
declarations: [forwardRef(() => AppComponent)],
//declarations: [AppComponent],
exports: [forwardRef(() => AppComponent)],
imports: [BrowserModule, CommonModule],
})
export class AppModule {}Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Angular fails to resolve the `ngIf` directive.
Please provide the environment you discovered this bug in (run ng version)
Angular: 13.3.4
... common, compiler, compiler-cli, core, platform-browser
... platform-browser-dynamic
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1303.3
@angular-devkit/build-angular 13.3.3
@angular-devkit/core 13.3.3
@angular-devkit/schematics 13.3.3
@angular/cli 13.3.3
@schematics/angular 13.3.3
rxjs 7.5.5
typescript 4.6.3
### Anything else?
_No response_
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimebug