I'm starting with EMBER.js, and there are some doubts that I have:
Let's say that I am creating a simple chat, just for the example. I have a left-side panel with a list of users, and a right-side panel with the messages sent.
I considered creating a component called: users-list
, that displays a list of users. Every member of that list should be another component called user
.
This means that a user
component is responsible of drawing itself, with the user name, last sent message, name color, etc... (all are properties) and also has some actions in buttons beside its name: changeName, changeColor, leaveRoom.
While a users-list
is responsible for maintaining a list of users and displaying them using the user
component.
So the questions here are:
- Is this the proper way to go?
- If it is: How can I delete an item from the
users-list
component, from an action inside of the childuser
component (leaveRoom
action)? - If not: How should I implement that? I'd like to keep responsibilities isolated.
Aucun commentaire:
Enregistrer un commentaire