My simple SPA has 3 parts together on one page:
- A list of photos
- A list of frames
- A list of final products (photo in frame)
User chooses a photo and a frame to form a new product. New photos and frames can be added too.
I think the controllers should look like this:
App.ProductsController = Ember.Controller.extend({
needs: ['photos', 'frames'],
photosBinding: 'photos',
framesBinding: 'frame',
actions: {
newProduct: function () { ... }
},
....
});
App.PhotosController = Ember.Controller.extend({ ... });
App.FramesController = Ember.Controller.extend({ ... });
As I am very new to Ember, I don't know how I should work out the rest of it.
- Do photos and frames need their own routes? If yes, how should I prevent the user from modifying the URL and showing something that should not be displayed. If no, how do the controllers connect to their models?
- I want the creation of new photos and frames to be handled by their respective controllers, how can I do this?