From what I understand actions are meant to be used in templates to handle user events. However, in some Ember projects I sometimes see heavy use of the send function in controllers and other places that it doesn't feel like it belongs.
At first this doesn't seem like an idiomatic use of actions but then why have the send function at all? If actions were only ever meant for user events than they would only ever be accessible from templates and everything else would make explicit function calls.
In short, is there some convention for using actions from controllers? A rule of thumb?
Aucun commentaire:
Enregistrer un commentaire