-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Open
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: directive matching
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
compiler
Description
Currently, template dependencies for standalone components are imported and configured within TypeScript files, even though their main application is within HTML templates. This establishes a gap between where the dependencies are defined and where they are implemented.
Proposed solution
I propose a syntax that allows dependencies to be directly imported into the HTML template files. Taking inspiration from the proposed "let syntax" #15280 , the proposed syntax could be:
@import {NgClass , NgStyle} from "@angular/common"
<div [NgClass]="something" ></div>
<!-- or -->
<div [ngStyle]="something" ></div>
@defer(..){
@import {SomeComponet} from "something";
<SomeComponet />
<!-- or -->
<some-componet />
}
Moreover, Imports could also be scoped to deferred blocks for lazy loading.
Alternatives considered
None
keatkeat87, SebastianStehle and n-monroyzygarios and endlacer
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: directive matching