🤖 Create an engaging chatbot from scratch and add it to your NativeScript app! Learn more at our webinar on March 28th.

NativeScript Angular

Htmlview

The HtmlView represents a view with HTML content. Use this component instead of a WebView when you want to show static HTML content.

Image

Creating Htmlview

Create HtmlView via HTML

<HtmlView [html]="htmlString" ></HtmlView>

Create HtmlView via TypeScript

import { Component } from "@angular/core";

@Component({
    moduleId: module.id,
    templateUrl: "./creating-htmlview.component.html"
})

export class CreatingHtmlViewExampleComponent {
    public htmlString: string;

    constructor() {
        this.htmlString = '<span><h1>HtmlView demo in <font color="blue">NativeScript</font> App</h1></span>';
    }
}

Improve this document

Demo Source


API Reference for the HtmlView Class

Native Component

Android iOS
android.widget.TextView UILabel