IxDay
IxDay

Reputation: 3707

Angular $compile outside modules

I have an issue with AngularJS compile service. I am working out of angular but I can not compile my template, (I either try with a controller but I do not know why it does not work).

Due to specific development I can not use directives nor controllers.

Here is a Plunker of my issue: http://plnkr.co/edit/u9nfopTiikxjXmwzOgqh?p=preview

PS: This is a simple example, but I really need the compile service ($interpolate does not feet my needs)

Upvotes: 3

Views: 1400

Answers (1)

artur grzesiak
artur grzesiak

Reputation: 20348

It works! Just call scope.$apply(). Btw. if you be calling result.html() you are appending the copy of html that is not bound any more to the scope. If you just append result, the magic happens... Look at the PLNKR.

Upvotes: 3

Related Questions