Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular $compile outside modules

Tags:

angularjs

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)

like image 968
IxDay Avatar asked Feb 02 '26 18:02

IxDay


1 Answers

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.

like image 117
artur grzesiak Avatar answered Feb 05 '26 07:02

artur grzesiak