ryanflorence/ember-tools

Support Custom Base Classes for Routes, Controllers, Models, Views, etc.

Closed this issue · 2 comments

It would be nice when generating a class to specify a custom class to extend.

For example when building an application with authentication (like in the example from Embercasts), I might have an AuthenticatedRoute class that extends Ember.Route. Then when I create new routes where I want to force users to be authenticated I would just extend AuthenticatedRoute (e.g. App.ContentRoute = App.AuthenticatedRoute.extend()).

In this scenario, usage might be something like:

ember generate -r AuthenticatedRoute -e Ember.Route
ember generate -r ContentRoute -e AuthenticatedRoute

Here -e is a proposed option where you specify which class you are extending.

I'm working on a new project that will let you do this quite easily, should be released soon :)

Sounds good. Looking forward to it.