0

I'm currently injecting html into my view with

<span ng-bind-html="injected"></span>

$scope.injected = $sce.trustAsHtml("<input type='hidden' value='{{query}}' name='q'>");

But the data binding isn't getting initialised. Not 100% sure if I need to run it through something else before injecting it in the page.

4
  • 1
    You need to compile your html. Commented Aug 31, 2014 at 2:18
  • Why this html needs to be injected? what it cannot be a directive template? Commented Aug 31, 2014 at 2:29
  • Thanks dasu908, exactly what I needed. Dalorzo: The input I inject depended on other things in a form being set on a form. Commented Aug 31, 2014 at 2:43
  • @user3985676 something like this do you mean Online Demo Commented Aug 31, 2014 at 2:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.