Reputation: 1126
Currently I have a set up a application that lists the model collection and also have implemented pagination in it.
Now, I want to move all of this logic into a component so that it is reusable across multiple listings. To achieve this, I have passed the model variable inside the component.
Since, server data communication is considered a bad practice I assume the changes must be applied to the controller ?
So, I am confused on how to make the api call to refresh the data can be called ?
Upvotes: 1
Views: 730
Reputation: 591
You can build method in controller and pass them as method in the required components. This way, you can avoid data call in component and make it reusable.
eg:
{{some-list getData=getSomeListData}}
where getSomeListData
applies the required data changes.
Upvotes: 1