$compile允许您使用所谓的克隆附加功能,该功能允许您将元素附加到文档。这是您可能可以使用的示例:
var template = "<div> .. {{someCompilingStuff}} ..</div>";var compiled = $compile(template)(cellScope, function (clonedElement) { cellElement.popover({ html: true, placement: "bottom", trigger: "manual", content: clonedElement });});参考有关$
compile使用的Angular文档



