Search code examples
ionic-frameworkionic-view

Opening browser and opening a particular website on ionic framework


Hi I would like to ask how will I be able to open a browser and going to a particular website by clicking an icon on a mobile application with ionic framework. For example I clicked the youtube icon on the Ionic framework app, it will open a browser and go to youtube.


Solution

  • User Inappbrowser plugin in your project to open external links. Plugin Documentation .

    General Steps:

    1. add plugin using command
      ionic plugin add cordova-plugin-inappbrowser
    2. Use this line where you want to open link


    var ref = cordova.InAppBrowser.open('http://youtube.com', '_blank', 'location=yes');