Ivy: Render HTML from String / dynamic rendering
### 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: ``` Html <render-component [html]="..." [render-data]="{ show: true}></render-component> ```` [html] has the following value: ``` Javascript "<p *ngIf=\"show\">Hello!</p>" ``` Which display in the case if show is true: ``` Html <p>Hello!</p> ``` ### Alternatives considered An Service to render html on the fly. E.g.: [p3x-compile](https://github.com/patrikx3/angular-compile) [Html Compile](https://github.com/codehint-ng/ng-controls/blob/master/projects/html-compiler/src/lib/html-compiler.component.ts)
Posted by nfMalde on Jan 7, 2022, 3:35 PM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
Ivy: Render HTML from String / dynamic rendering
### 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: ``` Html <render-component [html]="..." [render-data]="{ show: true}></render-component> ```` [html] has the following value: ``` Javascript "<p *ngIf=\"show\">Hello!</p>" ``` Which display in the case if show is true: ``` Html <p>Hello!</p> ``` ### Alternatives considered An Service to render html on the fly. E.g.: [p3x-compile](https://github.com/patrikx3/angular-compile) [Html Compile](https://github.com/codehint-ng/ng-controls/blob/master/projects/html-compiler/src/lib/html-compiler.component.ts)
Comments (0)
No comments yet. Start the discussion.