I’m integrating ProseMirror into an Angularjs 1.x app.
I have a custom element <file-viewer> that support attribute url (the content to display) and viewer (the type of the content)
On the Angular part, all is handled by angular itself
I’m struggling on the prosemirror part to render this custom element.
The thing I’m currently experimenting is using a NodeView to render my element. The thing is it need to fetch data from the backend before rendering:
parse
fetch id aaa from db, return url and type
put in the dom
Point 2. is where I’m lost.
I currently have a function returning a Promise<NodeView<any>>
But of course I think it’s not designed to work.
I’ve tried to follow the Image Upload async example but that doesn’t seems to fit here
What can I do for this use case (also, I’m no expert with prosemirror yet)
When instantiating the node view, I would assume. You’ll definitely want to keep a cache somewhere so that this doesn’t make tons of repetitive requests.