JobQuery/jobquery-client — pull request #47 by FCStrike (2014-06-15 23:30:32+00:00)
Title: Refactor Company restful service

This is a big one.

Instead of injecting controllers which is a bit clunky, we're going to directly inject the services. While relatively straightforward, I also felt that we can provide a better wrapper over the $resource object (a bit more nontrivial).

Notice that in Rest.js for the Company model, I converted the original $resource into a CompanyResource service. This is used by a Company model which itself exposes four high level methods: getAll(), get(id), create(company), and update(company). All return a promise which can then be chained off of using .then.

I feel that this is a better way of doing things, but the change requires a significant overhaul of our testing suite. I'd be happy to do the entire refactor of the team is onboard with these changes.