Personally I use the following pattern quite a lot:
{{action 'toggleModalVisibility'}}
with the following action:
toggleModalVisibility: function () {
this.toggleProperty('isModalVisible');
}
And I can see this being something that is just built into a handlebars helper, where you don’t have to create the action. For example:
{{toggle isModalVisible}}
Would toggle that property on the controller, and the ‘action’ would be built into the toggle
helper. It could also have the target
attribute that action has. I probably have at least 20 of these types of actions in my current application. Seems like a pattern to me.
Has anyone else had this experience?