Groups
Groups
Sign in
Groups
Groups
Angular and AngularJS discussion
Conversations
Labels
About
Send feedback
Help
Angular 6 - Rendering of dynamic content
18 views
Skip to first unread message
Christoph Kind
unread,
Aug 17, 2018, 12:19:54 PM
8/17/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Angular and AngularJS discussion
How can I get dynamicly added content to get rendered?
For example:
var
box
=
$
(
'#content-box'
);
box
.
append
(
"<p>Test {{ binding }}</p>"
);
{{ binding }} will not get rendered.
Any suggestions?
Regards
Chris
Sander Elias
unread,
Aug 17, 2018, 11:46:48 PM
8/17/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Angular and AngularJS discussion
Hi Christoph,
While possible by manually invoking the compiler, it's not an easy thing to do.
Can you give a sample of what it is you are trying to do, usually there is a simpler way to accomplish the same.
Regards
Sander
Zlatko Đurić
unread,
Aug 18, 2018, 2:58:52 AM
8/18/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Angular and AngularJS discussion
If you just want to render some hand-written HTML, use DomSanitizer (
https://angular.io/api/platform-browser/DomSanitizer
, here is an example:
https://stackblitz.com/edit/angular-safe-unsafe-html
) in your component. If you want more dynamic behavior with template binding etc, you can either try to build out this component dynamically (e.g. like in this answer on SO:
https://stackoverflow.com/a/48028892/162070
). Hope that helps.
Zlatko
Reply all
Reply to author
Forward
0 new messages