I am using froala in my angular2 project. I have successfully uploaded image but cannot trigger the image.uploaded
event. In froala document, event is something like this
$('.selector').on('froalaEditor.image.uploaded', function (e, editor, response) {
// Do something here.
});
But i am unable to implement this in ts code.
One more thing which is difficult to find online is how to use methods from froala in angular2.
From froala documentation, you can see item.action, so you can use it as item.action() in angular2. For example with hiding toolbar.
TYPESCRIPT:
export class FroalaEditor {
public editor;
public model: string = '';
public options: Object = {
events: {
'froalaEditor.initialized': (e, editor) {
this.editor = editor;
}
}
}
showToolBar() {
this.editor.toolbar.show();
}
}
HTML:
<div [froalaEditor]="options" [(froalaModel)]="model"></div>