@dimas09 wrote:
I have next line in my template
{{some-fancy-component mydata=mydata editAction=(action 'edit') deleteAction=(action 'delete') addAction=(action 'add')}}
And in my component
some-fancy-component
I have next lines:@action callEditAction(...attrs){ if (this.editAction){ this.editAction(...attrs); } } @action callDeleteAction(id){ if (this.deleteAction){ this.deleteAction(id); } } @action callAddAction(...attrs){ if (this.addAction){ this.addAction(...attrs); } }
Yes, I should avoid duplication of code but it’s to make the example more verbose. I think should be a possibility to avoid of creation these dummy action in
some-fancy-component
component.
Posts: 1
Participants: 1