Simplified I have the following problem, I want to append to a div using the jquery function .append(), an Angular directive and it won't work. I've created a jsfiddle to make my point. http://jsfiddle.net/H26eg/2/
Do you have any idea why isn`t it working and what should i do?
I think it is related to this http://docs.angularjs.org/api/ng.$compile but can`t figure it out..
Thanks a lot !
EDIT:
I've managed to do the above using two directive, calling one directive from the other like this: http://jsfiddle.net/H26eg/6/ . The problem is if instead of regular template:"html_text" in anpr directive I use templateUrl: "path_to_html_file" again it won't compile the directive. Can somebody please tell me how to compile the templateUrl directive ?
define a directive and use a template, which will automatically get compiled for you by Angular.This is exactly what Ive done but why isnt Angular compiling my directive when I`m adding it to my div using the .append() function ?t managed to make it work properly. The problem im facing now is that angular wont compile the templateUrl im loading from my directive. If i use only template:"html_text" it works but if i change it to templateUrl it won`t load. Can you please give me a tip or an ideea ? jsfiddle.net/H26eg/6