Closed robertsoniv closed 7 years ago
JavaScript promises are a wonderful tool that are still fairly new. Because it’s not native to all browsers yet, most js frameworks have to create a custom integration that keeps track of promises and any events they create. This also means that the promises created by Parse’s SDK do not fire the Angular digest cycle when they resolve. The following is an example controller implementation of the repository we just created. The one major problem? The $scope array is never rendered to the view.
Seems like I might have to beef up the angular wrapper for the SDK to fix this problem.
fixed in oc-wrapper
When using this SDK in an angular controller, my response body comes back into the .then() just fine where I can log it to my console; however, if I attempt to set the response body data to a variable in my controller the angular scope is not updated.
I believe there must be some difference in how promises are handled in angular vs. raw javascript.
Interesting side note, I do not have this problem when using the new SDK in a ui-router resolve - the data populates into the controller just fine in this case.