Skip to content

Commit 0acbf44

Browse files
committed
Fix null value
1 parent 356dd1c commit 0acbf44

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ Import the according component:
4242

4343
```ts
4444
import { Markular } from 'markular';
45+
import { FormsModule } from '@angular/forms';
4546

4647
@Component({
47-
imports: [Markular]
48+
imports: [Markular, FormsModule]
4849
// ...
4950
})
5051
export class MyApp {

projects/markular/src/lib/markular.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
input,
1010
InputSignal,
1111
output,
12-
ViewChild,
12+
ViewChild
1313
} from '@angular/core';
1414
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
1515
import { marked } from 'marked';
@@ -107,7 +107,7 @@ export class Markular implements AfterViewInit, ControlValueAccessor {
107107

108108
writeValue(value: string) {
109109
// console.log('write value', value);
110-
this._val = value;
110+
this._val = value || '';
111111
this.appendHistory();
112112
this.historyIndex--;
113113
// this.elementRef.nativeElement.querySelector('textarea').value = value;

0 commit comments

Comments
 (0)