S
S
softshape2019-05-31 13:44:05
Angular
softshape, 2019-05-31 13:44:05

AngularJS: how to do without $compile?

Reworking legacy AngularJS code; in one of the places, instead of a directive, the content becomes static and needs to be transferred to ng-bind-html - At the same time, inside hint.html, in addition to just HTML, there are custom directives. While this HTML was being produced inside the directive, there was a line there and after that everything worked as it should. But I don't know how to add $compile to ng-bind-html ? And without $compile on the page, instead of custom directives, there is just a hole. Is it possible to call $compile from external JavaScript code? Or is there some way to tell Angular to compile the ng-bind-html content?
<span ng-bind-html="hint.html | toTrusted"></span>
$compile($element.contents())($scope);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question