相关疑难解决方法(0)

在Angular 2中等效$ compile

我想手动编译一些包含HTML的指令.$compileAngular 2中的等价物是什么?

例如,在Angular 1中,我可以动态编译HTML片段并将其附加到DOM:

var e = angular.element('<div directive></div>');
element.append(e);
$compile(e)($scope);
Run Code Online (Sandbox Code Playgroud)

version-compatibility typescript angular2-compiler angular

127
推荐指数
4
解决办法
6万
查看次数