Closed ghost closed 7 years ago
Not possible, you can not inject html with components/directives.
its not a limitation from ngx-modialog
, Angular does not work that way.... dynamic component creation can only work through code.
Use custom component approach instead, see demos for example.
@shlomiassaf where is the example with custom components?
Where is the custom component 👎
For anyone still searching the demo can be found (for Bootstrap powered dialogs) here
Hi I tried adding a search bar into the modal like so and I got a sanitization warning.
The relevant objects that the html in .body references are in the same file as the function onClick. Nothing is displayed, similarly just trying to add an html element like a button to .body renders the same warning. So I thought I would pass an ng-template to .body (i.e. .body(myTemplate)) but it just displays [Object object]. Is it possible to pass a template object to .body?