I read in a recent ember release (couldn’t find the link) saying that now the store is available as a service and thus could be used within a component, for example. However, the example only shows how to get records from the store.
I would like to save a record which is a parameter for a component, but when I’ve tried I get this error:
Uncaught RangeError: Maximum call stack size exceeded. I think it is because it was not able to find store to handle it.
Is it possible to do this? Furthermore, is this a correct approach to the store usage and components?
Here’s a minimal example of the component I’m thinking of. I usually just have this as a controller, but now that we’re moving towards a component oriented approach I thought I’d try it.
Thanks, I know I have to use this.get('store') to access the store on a component. However, to perform a save operation, ember cannot find the store as it’s done through the record object and I haven’t found a way to force the record object to use a particular store instance.
@mfeckie: I didn’t know about sendAction, but I think that’s a better approach, thanks! What I have no idea of how to do is tell the controller to apply the action to a particular record (the one associated to the component that triggered the action).