Returning child routes in an abstract view in Angular JS

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 defined in a parent route (abstract). I need to know if there is any way I can start a controller when I bring all the existing child routes to that parent route.

route example in a routes.js file:

$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 of type ["app.foo","app.bar"] so that I can from there work on functions of the parent controller.

Does anyone have any idea how to do this?

    
asked by anonymous 19.11.2015 / 14:01

0 answers