Closed riannucci closed 10 years ago
(it's also possible that I'm a bad person for wanting to do this :)).
Yup, classy.controller
will return itself rather than the module. The reason for this is so you can inline a Classy controller in routes and directives and other places. For example:
app.directive('classyDirective', function() {
return {
controller: app.classy.controller({
inject: ['$scope'],
init: function() {
this.$.testing = 'worked';
}
})
};
});
Ah cool. I'll just do the non-dumb thing then :smiley:
With Plain-Old-Angular controllers, I can do (forgive my coffeescript):
But if I try this with classy:
I suspect that something ought to be returning the module again somewhere, but I'm not sure where to poke (otherwise I'd offer a pull request :)).
Of course, the workaround is easy: