0

Guys I got a problem (lack of experience) in ngRouter, I can work with the parameters in routes with two ex levels:

editoria/:itemId

.when('/editoria/:itemId',{
        templateUrl:"templates/editoria/index.html",
        controller:'EditoriaCtrl'
})

however, must use a primary route

/:editoriaId

.when('/:itemId',{
        templateUrl:"templates/editoria/index.html",
        controller:'EditoriaCtrl'
    })

I hope I have been clear, hehe

how do I do?

1
  • what is your question? Commented May 19, 2015 at 19:25

1 Answer 1

1

Yes, with ngRoute, you specify the path (starting from base) to match the route so you need to specify it fully.

If you were to use ui.router - a much more feature-rich alternative to ngRoute - then you could have a parent-child relationship of states:

.state("editoria", {
  abstract: true,
  url: "/editoria"
})
.state("editoria.item", {
  url: "/:itemId",
  templateUrl: "templates/editoria/index.html",
  controller: "EditoriaCtrl"
})
Sign up to request clarification or add additional context in comments.

1 Comment

you're right, I am using ui-router and really has become simpler, thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.