uor/angular-model — pull request #9 by warrenseymour (2014-01-19 11:13:06+00:00)
Title: Implement dirty checking and only PATCHing modified fields

Implements the following instance methods and properties:

- $original - cached state when initially retrieved from data source
- $dirty() - returns a boolean, true if instance has modified fields
- $pristine() - returns a boolean, true if instance has no modified fields
- $modified() - returns an object of fields that have been modified with their new values
- $revert() - resets current state to $original

PATCH payloads now only contain modified fields. On a successful PATCH, $original is updated to the new state, making the instance $pristine() again.

Todo:

- Make dirty checking configurable via provider as per #8
- Make deep dirty checks and diffs.