编辑器组件-已创建ngx编辑器并进行了配置
`
<app-ngx-editor [config]="editorConfig" [spellcheck]="true" [(ngModel)]="htmlContent"></app-ngx-editor>
<div *ngIf="htmlContent" class="htmlblock block">
<h6>HTML Output</h6><div class="html">{{ htmlContent }}
</div>
`
我的共享组件
`
<div class="editorbtn">
<button class="btn"(click)="shareContent()">Share Editor</button>
<div class="editor">
<app-editor [htmlContent]="htmlContent" *ngIf='editorStatus'></app-editor>
</div>
`
我的共享组件ts
`
@Input() editorStatus = false;
@Output() htmlContent;
shareContent() {
console.log('Output Html content: 'this.htmlContent);
// console.log('Output Html content using emit: 'this.htmlContent.emit());
}
`