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_
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.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
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