Add an wysiwyg-editor on your angular app


When you are creating your own custom blog one necessary component that you have to add is an editor that you can stylize your writings.

I found a fine library that is hosted in npm repository and is called ngx editor(ngx-editor).

I will add the functionality below :

app.module.ts

import { NgxEditorModule } from 'ngx-editor';

imports: [
    ...
    NgxEditorModule , 
    ...
 
  ]

yourName.component.ts

   <app-ngx-editor [placeholder]="'Enter text here...'" [spellcheck]="true" [(ngModel)]="loop">      </app-ngx-editor>       
          <button class="btn btn-lg btn-primary btn-block" type="submit" [disabled]="!loop" (click)="articlePost()">Post</button>


If you want to see the whole logic on the frontend and the backend code see this repository => github

Σχόλια