0

I have a directive-container (with support for transclude), that needs to take the transcluded html exactly as it is and pass it on to a service for further processing.

What is the correct way to get all such transclusion content from within the directive?

Note that the transcluded content is expected to be simple, HTML-formatted text, no events or bindings.

vitaly-t
  • 24,279
  • 15
  • 116
  • 138
  • could you add your code please? – Pankaj Parkar May 14 '15 at 11:14
  • transcluded HTML doesn't exist. What you are getting is jQuery like object. You can get HTML content from it - but you'll loose all bindings, events etc. https://code.angularjs.org/1.3.10/docs/api/ng/service/$compile – lujcon May 14 '15 at 11:18
  • @lujcon, I do not need events or bindings from it, just plain HTML as it is. I amended the question with this. – vitaly-t May 14 '15 at 11:29
  • @pankajparkar, a code showing what? An empty directive declaration with transclude attribute? I don't see the point. – vitaly-t May 14 '15 at 11:30
  • 1
    http://stackoverflow.com/questions/20032347/get-original-transcluded-content-in-angular-directive ? – Sergiu Paraschiv May 14 '15 at 11:42
  • @SergiuParaschiv, that looks about right :) I should have searched better. – vitaly-t May 14 '15 at 12:09

0 Answers0