This could be close to a solution. I’ll make this a bit more concrete with a slightly simplified actual example:
I have a custom “list type” that defines multiple choice questions in a document - I’d like to structure these just like a regular
ol or radio form element - basically a root node that defines the question group, then a series of possible responses that the user can select between. I want to be able to tie into my Angular code base to handle click events, perform validations/other actions when the user responds to things. In this case, we’ll have a DOM structure that looks like this:
response 1 DOM node
response 2 DOM node
The way Angular works, a hierarchy of “
scope” objects get created which mirror the DOM hierarchy and enable the inheriting/communication of context between the nested response elements and the question root wrapper controller. The approach I’ve been playing with is to try to manually find the appropriate parent scope and then set up the binding I want when the custom node view renders a new DOM element - the idea here was to set the
contentDOM attribute to a child of the question root so that Prosemirror can take over rendering all the children again. However, if there’s an easy way for question root, as a block node, to render all its children by hand with the appropriate scope reference, that would be ideal. Basically I’m envisioning not setting the
contentDOM attribute, and then manually calling almost the same rendering steps that Prosemirror would on children, but with the added step of calling
$compile with the wrapper node’s scope. Does that make sense? Can you point me in the right direction for how I would go about manually rendering all of a block node’s children?
Thanks for you help!