App works when running from browser but not from emulator

Hello, my problem is that the app only works in the browser (using ionic serve). When doing an ionic emulate ios it just shows a blue bar on the top of the screen and nothing else. Let me show you.



I’m very new to ionic and hybrid mobile app development in general. I’ve only done native ios before. Can you tell me what’s wrong. If the emulator gives any errors how can I view them?

Update It works correctly if I run on the simulator with --livereload

Try using chrome://inspect and checking the console for any errors upon running.

i enabled remote debugging on safary and have a bunch of errors like this for every view I added to my project. What is wrong?

Failed to load resource: The requested URL was not found on this server. file:///app/components/login/login.html


Ok, I found the error. When specifying the routes to the views I added a / to the beginning. That was the problem. It was

templateUrl: '/app/components/login/login.html'

instead of

templateUrl: 'app/components/login/login.html'

Try this new browser MERCURY WEB BROWSER . U can find it here . Don’t worry this site is reliable ( no viruses, no bugs). For me it more convenient.

My next problem is that it doesn’t work on a real device. It looks like this:


Try enabling console and server logs when running the emulator:

ionic emulate [ios|android] --livereload --consolelogs --serverlogs

This way you can check your terminal for errors to make debugging easier.

Ok, everything looks ok, this time the problem was that I didn’t know filenames (css and js) are case sensitive when adding them to index.html.