I am currently working on integrating the InAppBrowser in IONIC2.
Successfully installed Browser Plugin
ionic plugin add cordova-plugin-inappbrowser
Here is my .TS code for opening the browser
browser(url:string)
{
this.platform.ready().then(() => {
open(url, "_blank", "location=true");
});
}
And here is the corresponding HTML code
<button (click)="browser('https://www.google.com')" >Open Browser</button>
However, when trying to execute it
I encountered the following error message:
ORIGINAL EXCEPTION: TypeError: Cannot read property 'ready' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'ready' of undefined
at HomePage.browser (http://10.44.71.150:8100/build/js/app.bundle.js:180:22)
at DebugAppView._View_HomePage0._handle_click_27_0 (HomePage.template.js:500:28)
at http://10.44.71.150:8100/build/js/app.bundle.js:26022:24
at http://10.44.71.150:8100/build/js/app.bundle.js:34969:36
at http://10.44.71.150:8100/build/js/app.bundle.js:35039:93
at ZoneDelegate.invoke (http://10.44.71.150:8100/build/js/zone.js:323:29)
at Object.onInvoke (http://10.44.71.150:8100/build/js/app.bundle.js:30600:41)
at ZoneDelegate.invoke (http://10.44.71.150:8100/build/js/zone.js:322:35)
at Zone.runGuarded (http://10.44.71.150:8100/build/js/zone.js:230:48)
at NgZoneImpl.runInnerGuarded (http://10.44.71.150:8100/build/js/app.bundle.js:30633:78)
Am I missing something here?