New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngIf="returnsPromise() | async" goes to infinite loop #6696
Comments
this is expected behavior, because each time the method is called, you're returning a new instance of the promise, which when resolved, triggers change detection, which retrieves a new promise, which triggers change detection.... You should a) generally avoid calling methods from the view and b) assign a promise to a property |
@robwormald The example given in the docs describes piping a promise to AsyncPipe. Should those docs be updated? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I was experimenting with AsyncPipe that this happened. If a method is returning a promise and you pipe it to AsyncPipe it will go to infinite loop and crashes the browser.
Sorry for screenshot, tab was frozen and I couldn't copy the code
The text was updated successfully, but these errors were encountered: