Error TS2346 Build:Supplied parameters do not match any signature of call target. while using inAppBrowser


#1

I am getting error while using inAppBrowser

hello-ionic.ts file code :

import {Component} from ‘@angular/core’;
import { Slides } from ‘ionic-angular’;
import {InAppBrowser} from ‘ionic-native’;

@Component({
templateUrl: ‘build/pages/hello-ionic/hello-ionic.html’
})
export class HelloIonicPage {

constructor() {
}

openBrowser(){
let browser = new InAppBrowser(‘https://ionic.io’, ‘_system’);
}

}

hello-ionic.html code :





Hello Ionic

Open Browser

TypeScript error: C:/Users/Chirag Jagga/IonicFinal/app/pages/hello-ionic/hello-ionic.ts(14,15): Error TS2346: Supplied parameters do not match any signature of call target.


#2

I solved this problem with following code:

let browser = InAppBrowser.open('https://ionic.io', '_blank');

If you want add some listener for the InAppBrowser’s events, you can do this:

browser.addEventListener('loadstart', (event) => {
      // code
});

Then, the full code is:

openBrowser(){
    let browser = InAppBrowser.open('https://ionic.io', '_blank');

    browser.addEventListener('loadstart', (event) => {
        // code
    });
}

I hope this is helpful.