Happens on a current project where the user has the ability to "Follow" or "Unfollow" users. The follow/unfollow controller seems to not be smart enough to know that when mapped like this:
app.map('.btn-follow', ['myapplication.user.FollowController']);
and having an events map within the controller like this:
events: [
['context', '.btn-follow', 'click', 'Follow']
]
When we dig into the magic, it actually gets implemented like this:
$(root).delegate(selector, eventName, function(evt) {
var requestObj = new Request({}, this, evt, self);
if (typeof self.before != 'undefined' && typeof self.before[commandName] != 'undefined') self.before[commandName].call(self, requestObj);
self.methods[commandName].call(self, requestObj);
if (typeof self.after != 'undefined' && typeof self.after[commandName] != 'undefined') self.after[commandName].call(self, requestObj);
});
By passing in the values for "root", it would be ".btn-follow", and "selector", would also be ".btn-follow".