Reputation: 300
I want to compile a HTML string into Angular component.
I have a HTML string something like this:
<test-card></test-card>
<test-card></test-card>
<test-card></test-card>
....
There's already test-card
component in my Angular project.
So what I need is injecting an external Angular template string to my Angular view.
Here's expected result.
<div class="card"> ... </div>
<div class="card"> ... </div>
<div class="card"> ... </div>
Upvotes: 0
Views: 161
Reputation: 61
Angular 7 doesn't provide runtime compilation of templates like angularJS.
Maybe dynamic components could solve your issue :
https://angular.io/guide/dynamic-component-loader
Upvotes: 1