Content-Length: 287573 | pFad | http://github.com/angular/angular/issues/56125

F0 Directly Importing Template Dependencies in HTML Templates · Issue #56125 · angular/angular · GitHub
Skip to content

Directly Importing Template Dependencies in HTML Templates #56125

Open
@abdulkareemnalband

Description

@abdulkareemnalband

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/angular/angular/issues/56125

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy