Angular
Angular 컴포넌트로 82editor 쓰기.
npm i @82editor/core @82editor/angularimport { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Editor82Component } from '@82editor/angular';
@Component({
selector: 'app-write',
standalone: true,
imports: [FormsModule, Editor82Component],
template: `<editor-82 [(ngModel)]="html" [options]="{ toolbar: 'board', height: 400 }"></editor-82>`,
})
export class WriteComponent {
html = '';
}
// angular.json → "styles": ["node_modules/@82editor/core/dist/styles.css"]- standalone 컴포넌트이며
ControlValueAccessor를 구현해ngModel과 reactive forms 에서 그대로 씁니다. (change),(ready)출력이 있습니다.- Angular 17 이상.
Reactive forms
form = new FormGroup({ content: new FormControl('') });
// <form [formGroup]="form"><editor-82 formControlName="content"></editor-82></form>