Use arbitrary, dynamic HTML for $mdDialog contents

48 Views Asked by At

I want to be able to render and display any HTML (even containing javascript), coming from my server, in a dialog popup.

I am using a bunch of different combinations of $compile(...html from server)($scope) and angular.element and I cannot get it to work.

Here is a codepen with some examples.

The second and third buttons fail to produce a dialog as an error is thrown in the angular code.

What am I doing wrong?

Ideally the solution would allow for something like this

...
contentElement: some_func(... some HTML text from the server)
...
0

There are 0 best solutions below