harleyttd/angular-ordr — pull request #3 by xinsight (2013-06-10 10:11:55+00:00)
Title: centralized all data model access in Service

Moved all data model access to an OrderService, which is used by the various Controllers.

I've kept the data structures used by the original peepcode tutorial, even though they are a pain to work with. However, the details are all encapsulated in the Service, so the controllers don't need to know the gory details. And if this app was ever hooked up to a proper backend, only the code in the OrderService should need to change.

This pull fixes the same issue as: https://github.com/harleyttd/angular-ordr/pull/2 I guess the issue is: keep the original peepcode data structures, or just use them at startup to generate a nicer data structure.

One reason why this pull request might be better, is that I create a unique 'id' for each tabItem. Not useful currently, but I added it for deleting a particular food item from the tab. (A bit safer than just deleting by index.)