Returning daughter routes in an abstract view in Angular JS

Asked

Viewed 151 times

1

I am making a directive to create a Wizzard system, where the navigation of this Wizzard will depend on the number of routes that is set on a parent route (Abstract). I need to know if there’s any way when I start a controller, I bring all existing daughter routes to that parent route.

example of routes in a file Routes.js:

$stateProvider
  .state("app", {  url: "/",
    abstract : true,
    templateUrl: "templates/app.html",
    controller: "appController"
  })
  .state("app.foo", { url: "/foo",
    views: {
      'view-foo': {
        templateUrl: "views/foo.html",
        controller: "fooCtrl"
      }
    }    
  })
  .state("app.bar", { url: "/bar",
    views: {
      'view-foo': {
        templateUrl: "views/bar.html",
        controller: "barCtrl"
      }
    }    
  });

In my directive I would need to get a result like ["app.foo","app.bar"] so that I can from there work in parent controller functions.

Does anyone have any idea how to do that?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.