javascript - How to wait till the end of $compile in angularJS -
i'm loading template , compiling against scope using $compile
service.
var template = "<div> .. {{somecompilingstuff}} ..</div>"; var compiled = $compile(template)(cellscope);
and using in popover
cellelement.popover({ html: true, placement: "bottom", trigger: "manual", content: compiled });
my template quite complex , may take time compile.
how can make sure angular has finished compiling template before using in popover ?
edit: tried force angular $apply()
before creating popover, work generate javascript errors not acceptable me.
$compile
allows use called clone attach function allows attach elements document. here example may able use:
var template = "<div> .. {{somecompilingstuff}} ..</div>"; var compiled = $compile(template)(cellscope, function (clonedelement) { cellelement.popover({ html: true, placement: "bottom", trigger: "manual", content: clonedelement }); });
Comments
Post a Comment