I'm quite new to Ember and I'm quite lost to find the better approach for my application:
Application: Screen is splited horizontally in 2 parts:
- Left part is a form to fill Person attributes (name, lastName, email)
- Right part is a graphical view of the left form
I don't know exactly the best solution:
Solution1:
- Person object for the model (instance is a person object global variable for now)
- PersonFormController to manage the form and make the attributes validation
- PersonFormView to display the form
- PersonRenderedController: to manage the rendering of the form
- PersonRenderedView (only display view, no user interactions)
- The 2 controllers have a reference to the person global variable for their content property
- Use of "connect outlets" to connect the controllers/views router.get('applicationController').connectOutlet('left', 'personForm'); router.get('applicationController').connectOutlet('right', 'personRendered');
I'm not sure of this solution because the PersonRenderedController is not very useful and oly used for the "outlet connectivity".
Solution2:
- Person object for the model (instance is a person object global variable for now)
- PersonFormController to manage the form and make the attributes validation
- PersonFormView to display the form
- PersonRenderedView (only display view, no user interactions)
- NO personRenderedController (no need because only display mode for this view)
- NO outlets but manually creation of the 2 views (form and rendered) in the general template
I think that solution1 is perhaps more flexible (in case rendered view needs a controller)
Can you please advice ?