TIY-LR-FEE-2015-June / assignments

0 stars 3 forks source link

8.1 - Restaurant Menu - Jacklyn Carroll #197

Open jacklynlee31 opened 8 years ago

jacklynlee31 commented 8 years ago

Getting Started

jacklynlee31 commented 8 years ago

Trello Board: https://trello.com/b/6b5BaV48/8-1-restaurant-menu

PR: https://github.com/jacklynlee31/8.1-restaurant-menu/pull/1

MockUp:

8 1 restaurant menu

rtablada commented 8 years ago

So it looks like you still are working on getting your orders to show up on the sidebar.

In your current-orders service, try to make a function that accepts a menuItem and then pushes the item to the existing orderedFood array. Note that the normal push function on arrays doesn't fire observers and Ember won't recognize the change. So you'll need to look at Ember.ArrayProxy@pushObject: http://emberjs.com/api/classes/Ember.ArrayProxy.html#method_pushObject It works just like push, but it fires observable change events.

After you get items to add to the orderedItems array, you'll need to check your sidebar template because I think some variable names got out of sync.

Once you have that, add a new orderTotal computed property. You could use Ember.computed.sum to help with that. Note that if you use computed.sum, you'll have to first use mapBy just like you did to get the max in your catcode.

jacklynlee31 commented 8 years ago

@rtablada This should be ready to go.