I'm looking for a way to extend Ember's Object to include some additional methods, so that they become available every object (View, ArrayController, etc) in my app.
Specifically, I want to define some methods that introduces some naming conventions of the controllers, models, views, templates, helpers, etc.
For example:
If the class name of the View is ArticlesListView
then its associated model is Article
, the controller action is named list
within ArticlesController
, the template is in app/articles
named list.js.hjs
...
The end result should be, for example, App.ArticlesListView.model()
would return App.Article
.
So how do I extend the core Ember Object?
Ember.Object.extend({ // <--- ???
model: function(context, params){
}
});