0

I have tried a lot of thing to get routing working in angularjs. I have tried this: Angular ng-view/routing not working in PhoneGap and google all over the place but couln't get it to working.

i have my code on github https://github.com/rovox/rocinfoapp. All I get to see is a black topbar and the word test which is hardcoded into the index.html i can't get the homepage to show up?

Do you guys have any idea how to get this working?

Greeting

Community
  • 1
  • 1

2 Answers2

0

I think you might need to assign a controller to to each .when statement like:

 .when('/home', {
     templateUrl: 'partials/home.html'
     controller: MainCtrl
 })

I think that currently the code does not know which controller to use for each page. It would also be easier to help you if you provided a plunker or fiddle of your problem, as right now it is a little hard to follow and to diagnose your issue.

Jared Reeves
  • 1,382
  • 1
  • 15
  • 29
0

You have MainCtrl and ViewCtrl in App.controllers but in your app.js you aren't providing any controller to the routes you're defining. Assign them.

Btw, does that app work locally without PhoneGap?

Gui
  • 8,347
  • 10
  • 38
  • 54
  • But i Will try to add a controller, It does not matter of that controller is empty? – user3130512 Jan 30 '14 at 08:04
  • I don't know, i use ui-router with states (from angular ui) instead of angular-router, but give it a try and tell us if it solved. If not, i'll try it myself tonight – Gui Jan 30 '14 at 14:47
  • I ended up rewriting the hole app with using angular-phonegap-seed as the basic and now its working but I can't find the problem I had. If i copy and past my old code back in it stop working. Still looking for the problem. – user3130512 Jan 30 '14 at 18:19