Restangular promise chain when used in a service breaks?
Hi, I've (re)-created a plunker:
http://plnkr.co/edit/7Ir9K3
For some reason, the object returned by a restangular promise when called via a service breaks. But the same works when called within a controller. There are three use cases in script.js that explain the three scenarios.
Can you please explain this behavior?
Thanks!
Hey,
That's because you were calling the then on the promise, (which returns a new promise), but then returning in the service the old promise.
http://plnkr.co/edit/uQFJ7T?p=preview this is the same example but working!
Check it out!
That was because of not fully getting my head wrapped around promises! Thanks for helping.