Slate Ng
Demo
https://chongqiangchen.github.io/slate-ng/
Quick Start:
- install:
npm install slate-ng slate slate-history @angular/cdk
- import module:
SlateNgModule
- use
ns-editor
, ex:
// html
<div
ns-editor
[editor]="editor"
[value]="value"
placeholder="enter some"
></div>
// ts
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less'],
providers: [NsEditorService, NsDepsService, RegistryNsElement]
})
export class AppComponent {
editor = withAngular(createEditor());
value = [
{
type: 'paragraph',
children: [{text: ''}]
}
]
}
If you want to know more usage, you can refer to slate-ng demo code