import { Component, inject } from '@angular/core';
import { YelonFormModule, SFSchema } from '@yelon/form';
import type { TinymceWidgetSchema } from '@yelon/form/widgets-third/tinymce';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'form-tinymce-simple',
template: `<sf [schema]="schema" (formSubmit)="submit($event)" />`,
standalone: true,
imports: [YelonFormModule]
})
export class FormTinymceSimpleComponent {
private readonly msg = inject(NzMessageService);
schema: SFSchema = {
properties: {
remark: {
type: 'string',
title: '描述',
ui: {
widget: 'tinymce'
} as TinymceWidgetSchema
}
}
};
submit(value: {}): void {
this.msg.success(JSON.stringify(value));
}
}