Sander,

Thanks!

I shouldn't have even mentioned contenteditable. It muddies the water, and 
it turns out I can do what I need in a normal div that is not editable.

So if I simplify the question to how can I insert a 'live' angular 
component into an arbitrary spot of an existing div, that should be more on 
point.

I would appreciate any pointers on what is required to "compile the new 
element" and how to add it to the DOM while keeping the linkage between the 
component instance and the element intact.

Chris


On Tuesday, February 23, 2016 at 7:36:53 AM UTC-8, Sander Elias wrote:
>
> Hi Chris,
>
> What you want is at least tricky. If you enable contenteditable, basically 
> you put the content under direct control of the browser. The internal state 
> of the element is kind of unknown, until you are done editing. This makes 
> your request a much more challenging. It's not impossible tough, but be 
> prepared to deal with a bunch of edge-cases. 
> What you need to do when you want to insert a 'live' angular component is 
> to put the focus away from the editable, compile the new element before 
> adding it to the dom. Once that is done add it to your div at the location 
> you need it. and as last, move the focus back.
>
> Hope this helps you a bit forward!
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to