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>');
}

此代码将此 li 项目添加到我的列表中。但是 ng-include 不是从 angularJS 编译的

我能做些什么...?

4

1 回答 1

2

可能会以这种方式工作:

$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))
}
于 2013-11-09T19:09:24.180 回答