Dinesh Kumar
Dinesh Kumar

Reputation: 493

Markdown editor in Angular 4

I'm using ngx-markdown-editor in Angular 4. I want to use only the preview mode in ngx-markdown-editor.

<md-editor name="Content" [preRender]="preRenderFunc" [(ngModel)]="content" [height]="'200px'" [mode]="mode" [options]="options" required maxlength="500"></md-editor>

This will show with editor options. But I want only preview mode.

Upvotes: 1

Views: 1296

Answers (1)

Yanis-git
Yanis-git

Reputation: 7875

i have build this sample for you

On your template you have to call component like this :

<md-editor name="Content" [ngModel]="content" mode="preview"></md-editor>

As you can see, Attribute without [] expect to have value as string / number but not variable. Above syntax have same effect than :

<md-editor name="Content" [ngModel]="content" [mode]="{{ preview }}"></md-editor>

Upvotes: 1

Related Questions