vendredi 9 mars 2018

Ember.js: Add subroute to existing route

I have an ember-cli addon that creates routes. In the addon, I expose a configureRouter function that should be called by the application that is using the addon. In the application's router.js, in the map() callback, I call configureRouter, passing this. This works fine, no issues.

Now, in my application (not the addon), I need to add a sub-route to one of the routes that was created by the addon. As an example, the addon configureRouter function does something like this:

configureRouter(router) {
    router.route('a', function() {
      this.route('b');
    });
}

So that configures the route a.b. Now, back in the main application, I need to add the route a.b.c.

Is this feasible?




Aucun commentaire:

Enregistrer un commentaire