8000 Ivy: Render HTML from String / dynamic rendering · Issue #44660 · angular/angular · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ivy: Render HTML from String / dynamic rendering #44660
Open
@nfMalde

Description

@nfMalde

Which @angular/* package(s) are relevant/releated to the feature request?

compiler, core, platform-browser-dynamic, platform-browser

Description

As far as I know the old aproach was to inject the JITCompiler and use it to render your HTML in an anonymous component.
This worked so far. I use editable HTML in DB which uses key features as substituting variables and directives like *ngIf or *ngSwitch.

Which does not work anymore in production mode (Angular 12.x)
I browsed stackoverflow and other forums to find an workarround for this and these are not working anymore (like loading the JITCompiler into Providers, which results in "JIT Compiler unavailable".

As I found not soulution for ivy/ng 12 i considered this feature as still missing.

Best,

Malte

Proposed solution

Component to render html strings.

Example:

<render-component [html]="..." [render-data]="{ show: true}></render-component>

[html] has the following value:

"<p *ngIf=\"show\">Hello!</p>"

Which display in the case if show is true:

<p>Hello!</p>

Alternatives considered

An Service to render html on the fly.

E.g.:

p3x-compile
Html Compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compilerIssues related to `ngc`, Angular's template compilerarea: coreIssues related to the framework runtimecompiler: jitfeatureIssue that requests a new featurefeature: 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

      0