Running in the browser


#1

Hi,

I would like to run the app in a regular browser so I could inspect the DOM with developer tools and see what I can manipulate - for now, what I would like to do is change an icon in the tab bar to one of my own icons.

But when I start index.html inside the www folder it opens the browser with a blank page.

How can I view in the browser?
Is there a better way to change the icons to costume icons?

Thanks


#2

It should work without any modifications on a localhost using lamp, wamp, xampp or mamp (even the php 5.4 and python SimpleHTTP build in servers will work fine) unless you are using cordova plugins, which in this case will work but as the ionic.Platform.ready(callback) will not fire so you may see some errors in the console regarding this.

Otherwise, You can always run the app in iOS Simulator and add weinre or you can check a full list of Phonegap/Cordova debuging techniques in this wiki.

Regarding the icons issue, you can always add your web fonts icons in additional to ionicicons package, or using css images.


#3

Hi Jonathan,

Could you please link to a doc that will explain how the ionic app can run in the browser?


#4

I don’t think that this is documented, like you can run any HTML/CSS pages inside the browser you can do the same for Ionic. But you will have to run a local webserver to be able to do ajax requests and so on using javascript. I might misunderstood your question.


#5

In order to see it on localhost it has to run on some kind of a server. i already found a solution (very simple) using grunt-http-server. https://www.npmjs.org/package/grunt-http-server

5 minutes and i managed to run it on my local host :smile:


#6

Or use chrome with --disable-web-security flag , but use at yourown risk.


#7

From the www folder, in terminal run a python server

python -m SimpleHTTPServer

The open a browser to 0.0.0.0:8000

You won’t get any of the device specific features or use of the cordova plugins but its quick and simple (as the name indicates).


#8

cordova serve worked for me from the app directory.


#9

ionic serve works great


#11

dont work when i call from my localhost:8100 to www.mydomain.com , u need to enable CORS … how i can do that… pleaase… :’(


#12

i want to running ionic application in google chrome browser. i have run command ionic serve but running on mozila firefox.