Better integration with AngularJS
Ideally when working with breeze in an angular application you would not have to remember to call $apply when using async operations in breeze (eg calls to executeQuery).
I have created an angular module that monkey patches the EntityManager prototype so that the executeQuery (etc) returns a $q library promise and also calls $apply on the $rootScope. This angular module internally uses similar code to that posted here: http://www.breezejs.com/documentation/toqjs
However I've hit on a snag: code internal to breeze registers errorCallbacks using the 'fail' method on the promise object eg promise.then(callback).fail(errCallback)
The 'fail' method is not part of the CommonJS promise/A+ spec (https://github.com/promises-aplus/promises-spec), and as such is not included in the angularjs promise api.
The consequence is that the angularjs promise that the patched EntityManager.prototype returns does not have the fail method and so an exception is thrown.
Internally there are only 3 places in breeze that uses this 'fail' method to register an error callback so it seems like it would be very easy to change this code to support the CommonJS A+ spec ie: promise.then(callback, errCallback).
Please see Ward’s response.
Ward Bell commented
Christian - I regret that we will not pursue this request, for reason I explained to you in [our StackOverflow exchange](http://stackoverflow.com/questions/18360415/how-to-extend-breeze-to-be-interoperable-with-standard-commonjs-promises-spec).
Breeze's internal use of the Q `fail` method is not the issue; we could easily substitute a `then` call (and may choose to do so).
However, the angular $q is NOT "CommonJS Promises A" compliant - if for no other reason that it calls $apply as a side-effect - and we discourage monkey patching the EntityManager with $q.
If we make the change you request, it will be for other reasons. Please use the approved to$q method instead: : http://www.breezejs.com/documentation/toqjs