0
$scope.selectNode = function(node){
    $(".withOptions").append('<li id="list_7"><div><i class="icon20 i-folder-open"></i> '+node.title+' <i class="icon16 i-arrow-down-2"></i><div ng-include="\'http://localhost/test/public/admin/theme\'"></div></div></li>');
}

This code add to my list this li item. But ng-include dosn't not compile from angularJS

What can i do...?

2
  • Is there any reason you can't use a directive? Commented Nov 9, 2013 at 18:45
  • Do you have any example with directive? Commented Nov 9, 2013 at 18:54

1 Answer 1

2

Possible that will work in this way:

$scope.selectNode = function(node){
     $(".withOptions").append($compile('<li id="list_7"><div><i class="icon20 i-folder-open"></i> '+node.title+' <i class="icon16 i-arrow-down-2"></i><div ng-include="\'http://localhost/test/public/admin/theme\'"></div></div></li>')($scope))
}
Sign up to request clarification or add additional context in comments.

2 Comments

SyntaxError: missing name after . operator
Sorry, forgot "append". Also you will need to inject "$compile" into the function where you use this code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.