Use one way flow syntax property binding:
<div [innerHTML]="comment"></div>
From angular docs: “Angular recognizes the value as unsafe and automatically sanitizes it, which removes the <script>
tag but keeps safe content such as the <b>
element.”
More Related Contents:
- I want to create a color picker in ionic app [closed]
- Binding select element to object in Angular
- What to use in place of ::ng-deep
- How to declare a variable in a template in Angular
- Angular 2 Dropdown Options Default Value
- Show loading screen when navigating between routes in Angular 2
- Angular 5 FormGroup reset doesn’t reset validators
- Angular 2 Checkbox Two Way Data Binding
- Detect click outside Angular component
- Angular 2 Remove Hash (#) from the URL
- How can I repeat a piece of HTML multiple times without ngFor and without another @Component?
- How to load image (and other assets) in Angular an project?
- Dynamically ADDING and REMOVING Components in Angular
- Using HTML anchor link #id in Angular 6
- Angular2, what is the correct way to disable an anchor element?
- Chrome rendering issue. Fixed position anchor with UL in body
- Style not working for innerHTML in Angular [duplicate]
- Access Control Allow Origin issue in Angular 2
- How to remove the previously selected option from a drop-down menu in a table?
- How to show split header in the material table having nested group of data in angular
- Remove host component tag from html in angular 4
- Detecting real time window size changes in Angular 4
- Angular4 – Scrolling to anchor
- How to translate HTML string to real HTML element by ng-for in Angular 2?
- Angular2 without hash in the url
- Angular2 disable button
- How much faster is it to use inline/base64 images for a web site than just linking to the hard file?
- Get Angular2 routing working on IIS 7.5
- Create tree view with horizontal and vertical lines showing the connectivity using css
- How to serve up images in Angular2?