HTML is not being rendered when using [(ngModel)] in Chrome
See original GitHub issueWhen I attempt to set the initial content for the editor with HTML, it replaces my HTML with a <p> tag and then my content, igoring the HTML elements I entered into the [(ngModel)]. This is happening in Chrome version 62, and I’m using Angular 4, ngx-quill 1.6.0.
HTML:
<quill-editor #wysiwyg [(ngModel)]="wysiwygContent"></quill-editor>
Typescript:
export class ClinicNoteComponent implements OnInit {
wysiwygContent = '<ul><li>I am example content</li><li><u>Yo</u></li></ul>';
}
Result:
<p>I am example content<u>Yo</u></p>
Thanks for any guidance.
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (6 by maintainers)
Top Results From Across the Web
Why Angular's ng-model values are not reflected within web ...
Natively the value of an input is stored in the inputs node.value, it isn't something that you are going to be able to...
Read more >Property in ng-model not matching $scope.property in controller
I've got a property, pageSize, that is originally set in the controller, but can be updated through a select box. When I change...
Read more >Using NgModel With Input Type="File" And A Custom ...
Ben Nadel demonstrates how to create a custom ControlValueAccessor that targets File Inputs (type="file") and synchronizes File references ...
Read more >Angular ng-model Directive - W3Schools
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. The ng-model Directive. With the ng-model directive ...
Read more >Stack Overflow doesn't render some pages in Chrome with my ...
Not always the same content. So it appears to be a rendering issue. I can see HTML has loaded in the console. I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
<quill-editor [(ngModel)]=“wysiwygContent” name=“wysiwygContent” id=“wysiwygContent”></quill-editor>
@bMil21 try this It’s works for me.
Correct. My issue was a result of having the Quill Editor inside of an Angular Material tab, which was “flattening” it as
<p></p>for some reason. I simply had to wait for the tab to be active/visible, before setting the[(ngModel)]for the editor.