Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent of Android Webview In the ionic framework?

I created a IONIC/Angular JS application ; and I want to load a web page on it as is done with Android WebView; that is to say, display my web page in a division of my ionic application. So the question is, is there a IONIC component that can do this?

like image 419
user3679872 Avatar asked Feb 06 '15 20:02

user3679872


1 Answers

I know you posted this question a while ago. I had the same need to embed a webpage inside my ionic page and the solution I found was to add an iframe tag. Set the source to go to the link you want to embed.The iframe will contain the webpage inside the application. you can even create a controller to add further functionality. See my code below:

<ion-view>
  <ion-content class= 'padding has-subheader'>
    <iframe class= 'webPage' name= "eventsPage" src="http://www.algonquincollege.com/studentsupportservices/events/">
   </iframe>
  </ion-content></ion-view>

For styling you will need to target a div with the class scroll that gets created automatically by ionic. For example, I wanted to to make the webpage fill a width of 90%. see code below:

ion-content div.scroll{
  height: 90%; }

.webPage{
  width: 100%;
  height: 100%;
  border: 2px solid #EAAB00;
  padding: 1rem;}

Hope this helps. full details here: http://mobileapplicationsdesigndevelopment.blogspot.ca/

like image 149
Nehmat Gereige Avatar answered Nov 03 '22 20:11

Nehmat Gereige