Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Angular 1.2 rc3 ngRepeat doesn't work with promises #4728

Closed
jeffwhelpley opened this issue Oct 31, 2013 · 2 comments
Closed

Angular 1.2 rc3 ngRepeat doesn't work with promises #4728

jeffwhelpley opened this issue Oct 31, 2013 · 2 comments

Comments

@jeffwhelpley
Copy link

In my controller, I do something like:

$scope.posts = PostsModel.find();  // make ajax call and return promise

And then I use posts in my template in an ngRepeat, 3 blank elements are rendered in my web page BEFORE the promise is resolved. After the promise is resolved, blank elements remain in the rendered page. When I, however, do this:

PostsModel.find()
    .then(function (data) { $scope.posts = data; });

It works just fine. I may be wrong, but I thought Angular is supposed to hold off rendering until a promise is resolved.

@nosideeffects
Copy link
Contributor

No longer does this by default. You can turn this behavior back on manually in the short term, but it is only really there to ease migration.

$parseProvider.unwrapPromises(true)

@jeffwhelpley
Copy link
Author

Oh. Interesting. I was not aware, but this explains the issue pretty well:

#4158

Feel free to close.

@btford btford closed this as completed Jan 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants