Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set custom height for Ngx Editor

I am using ngx-editor for creating wysiwyg editor for my MEAN stack application. Everything is working fine but I want to set height for this editor. I have tried to set height in the css file for the component like

.ngx-editor[_ngcontent-c4] .ngx-editor-textarea[_ngcontent-c4] {
    height: 300px !important;
}

but still its not working.

Even I tried to set height from the component.html file like this

<div class="form-group">
      <label for="desc">Description</label>
      <app-ngx-editor style="height: 300px" [style]="{'min-height':'320px'}" formControlName="desc" [placeholder]="'Enter text here...'" [spellcheck]="true" [(ngModel)]="htmlContent"></app-ngx-editor>
    </div>

but still its not working.

Can someone tell me how to set the height for the editor? I have gone through its docs but not got any help so far. So can someone tell me how to set its height? Any help and suggestions will be really appreciable

like image 986
NewUser Avatar asked Dec 07 '22 15:12

NewUser


1 Answers

You can simply set the height of the editor using height and minHeight properties.

<app-ngx-editor height="100px" minHeight="50px"></app-ngx-editor>
like image 70
Sibiraj Avatar answered Dec 28 '22 08:12

Sibiraj