Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Ignoring the engine name from routes within engine

$
0
0

While splitting an application into an engine how do we resolve the route name that had been used before? For example, if my app’s route.js (before converting blog to an engine) is as follows

this.route("blog", function () {
    this.route("list");
    this.route("detail", function () {
        this.route("comments");
        this.route("edit");
        this.route("delete");
    });
});
this.route("docs");
this.route("home");
this.route("about-us");

After converting the blog as an engine

this.mount("blog");
this.route("docs");
this.route("home");
this.route("about-us");

And the blog engine’s route.js as follows

this.route("list");
this.route("detail", function () {
    this.route("comments");
    this.route("edit");
    this.route("delete");
});

Suppose if I have used a {{#link-to "blog.list"}} See All Posts{{/link-to}} somewhere within the blog before being converted to an engine then is there any way to access the blog.list route without modifying the link-to to {{#link-to "list"}} See All Posts {{/link-to}} after being converted to engine?

I have a large application where some files contain such route names (just to make the usage simple) and these files could get used anywhere in the whole app so if I change the route name by omitting the engine name (here in this case blog) in these files then chances are high that somewhere outside of the engine it may break.

When I tried to remove the engine name from those files I got

Error while processing route: blog.index Assertion Failed: fullName must be a proper full name

I don’t have an idea about what this error is trying to say.

If there is a solution without the need of removing the engine name from the routes within the engine that would be more helpful.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles