My goal is to set up any autosave implementation
I have a TinyMCE editor on my Blazor component and i dont know the best way to get the content from it. I can load the value from my model by using @bind-Value but am unsure of getting the updated value back.
This is my code so far
NotesPage.razor
<div class="editor" style="width: -webkit-fill-available; overflow: scroll; height: 100vh; padding: 0;">
<Editor ApiKey='my-api-key'
CloudChannel="5"
Conf="@editorConf"
@bind-Value="SelectedNote.Content" />
</div>
@code{
private NoteDTO SelectedNote { get; set; } = new();
private Dictionary<string, object> editorConf = new Dictionary<string, object> { { "menubar", false }, { "plugins", "link image imagetools code advlist codesample table" }, { "toolbar", "undo redo | styleselect | forecolor | bold italic | table tabledelete | alignleft aligncenter alignright alignjustify | outdent indent | link image | code codesample" }, { "table_toolbar", "tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol" } };
}
Im assuming JS Interop is the best way to implement this but im unsure as how to hook it up to respond to events ie. onkeypress, onchange....
I am using Blazor and .NET6