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.

2
  • By using $stateProvider you can achieve multiple page with mulitple controller. $state will support for nested views. Commented Apr 29, 2016 at 10:36
  • I tried using this example: stackoverflow.com/a/23997704/4988967, but still the linking isn't working. I used <a ui-sref="root.other">other</a>, but it doesn't redirect me. Am I doing it correctly? Commented Apr 29, 2016 at 11:00

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.