Inconsistency between `$observable` and `$observable.toPromise()`
marshall007 opened this issue · 4 comments
marshall007 commented
I would expect the following two examples to be equivalent, but it seems that when using toPromise
, the result is still a wrapped ResourceResult
:
resource.get({ id: '123' }).$observable.subscribe(
(value) => this.data = value // T
)
resource.get({ id: '123' }).$observable.toPromise().then(
(value) => this.data = value // ResourceResult<T>
)
marshall007 commented
Somewhat related, there appears to be a possible race condition when using resource.save(...)
which prevents $cleanData(...)
from being called before the request is sent.
troyanskiy commented
troyanskiy commented
Could you please provide plunker example to debug the Inconsistency between $observable
and $observable.toPromise()
Thanks
marshall007 commented
@troyanskiy not sure what was going on before, but I can't reproduce this again. Also updating to v3.2.4
seems to have fixed $
properties being included in POST
requests.