NativeScript is giving this error TypeError: Cannot read property 'loadData' of undefined while creating web-view
<p><a href="https://i.stack.imgur.com/744JS.png" rel="nofollow">---------------------------------------------------click here for error logs---------------------------------------------------</a>
below snippet is the code i used in my app.
i am getting the error in below line</p>

<pre><code> webView.android.loadData(html, 'text/html; charset=utf-8', 'utf-8');
</code></pre>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var vmModule = require("./main-view-model");
var webViewModule = require("ui/web-view");
var webView = new webViewModule.WebView();
var android = android;

function pageLoaded(args) {
    var html = '&lt;html&gt;&lt;body&gt;&lt;h1&gt;I can fuck?&lt;/h1&gt;&lt;/body&gt;&lt;html&gt;';
    var page = args.object;
   // var page = new pageModule.Page();
   // var web = page.getViewById(webViewModule.WebView,"webView");
    var webView = new webViewModule.WebView();
    webView.android.loadData(html, 'text/html; charset=utf-8', 'utf-8');
    page.content = webView;
    return page;
}
exports.pageLoaded = pageLoaded;</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded"&gt;
    &lt;StackLayout&gt;
        &lt;WebView id="webView" colSpan="4" row="2"  /&gt;
    &lt;/StackLayout&gt;
&lt;/Page&gt;</code></pre>
</div>
</div>
</p>