import { Component, inject } from '@angular/core';
import { DelonFormModule, SFSchema } from '@delon/form';
import type { TinymceWidgetSchema } from '@delon/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: [DelonFormModule]
})
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));
}
}