Reputation: 175
ERROR in src/app/pages/main/main.page.ts(61,27): error TS2554: Expected 0 arguments, but got 2. [ng] When i run the below code.I followed this tutorial for ionic 4 https://www.techiediaries.com/inappbrowser-ionic-v3/ The line 61 is InAppBrowser(........)
openUrl() {
this.platform.ready().then(() => {
let browser = new InAppBrowser("https://www.techiediaries.com","_system");
});
}
Upvotes: 0
Views: 313
Reputation: 128
As per the tutorial you linked, InAppBrowser has a create
function which you can use to do this;
let browser = this.InAppBrowser.create("https://www.techiediaries.com","_system);
The error you received is due to you using the constructor for InAppBrowser, which does not take any arguments itself.
The Ionic Framework documentation for InAppBrowser has some sample usage too which you may find helpful.
Upvotes: 1