0

I want to create an android application using Cordova, and I am using angularjs to fetch and handle data from the service end-point of a Drupal website. Initially I tried to use ngRoute of Angularjs but didn't seem to fit properly, so I turned to 'ui-route'. But I facing problems with ui-route as well.

My main aim is to use a particular view/template for multiple pages. I am new to Angularjs, so kindly help me choose the best way to proceed. My main question is how to handle multiple pages, can we just have each page as separate html file and link them or use routing. I tried to look into many tutorials but nothing helped me. Even giving an example would be enough.

Suresh R
  • 113
  • 1
  • 7
  • By using $stateProvider you can achieve multiple page with mulitple controller. $state will support for nested views. – Parthipan S Apr 29 '16 at 10:36
  • I tried using this example: http://stackoverflow.com/a/23997704/4988967, but still the linking isn't working. I used other, but it doesn't redirect me. Am I doing it correctly? – Suresh R Apr 29 '16 at 11:00

1 Answers1

1

I understand your problem. You can achieve this via $stateProvider but you don't know how. I am giving you a application link there you can see how to use $state.

kitchensink

download this application.

if you want to reuse your template then use custom directive and see this or more info angular

Community
  • 1
  • 1
Durgpal Singh
  • 11,481
  • 4
  • 37
  • 49
  • Thanks for your example, but it doesn't have multiple pages, it is just having a single template. My main problem is the need to reuse a template for other urls as well. – Suresh R Apr 29 '16 at 11:52
  • see this http://stackoverflow.com/questions/29836253/angularjs-reuse-template-and-bind-to-different-properties-within-the-same-scope – Durgpal Singh Apr 29 '16 at 12:12