Hi I\'m trying to implement tinymce into an angular 2 component for a small forum to create a new thread. I want the content of the textarea (tinymce) be 2-way-binded to a v
Or do it like this, using tmce's change event and NgZone
constructor(public zone:NgZone) {}
ngOnInit():any {
tinymce.init(
{
selector: ".tinyMCE",
setup: (ed) => {
ed.on('keyup change', (ed, l) => {
this.zone.run(()=> {
this.text = tinymce.activeEditor.getContent();
});
});
}
})
}
This would fail once you have more than one instance on tmce in one component. Put this logic in a directive like Thierry's implementation.