在 angular-bootstrap 弹出框内使用 Directive/Isolated 范围作为 HTML

Using Directive/Isolated scope as HTML inside a angular-bootstrap popover

使用angular-ui popover,您可以将html 放入弹出窗口中。例如,如果我有一个名为 sampleDirective 的指令(假设该指令存在),我如何将它放入弹出窗口中?我尝试使用 $sce.trustAsHtml 但它不起作用。我也试过$compile但是惨败

$sce.trustAsHtml('<sample-directive></sample-directive>');

有没有办法将元素指令放入弹出窗口中?

正如 Alon Eitan 所说,我没有使用 ui-popover-html,而是使用 ui-popover-template 并将指令的 templateUrl 定向到它。在这种情况下,不需要隔离范围不再..