Skip to content
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

Adding a delay to an observable pipe returns always null #26670

Closed
BenDevelopment opened this issue Oct 23, 2018 · 4 comments
Closed

Adding a delay to an observable pipe returns always null #26670

BenDevelopment opened this issue Oct 23, 2018 · 4 comments

Comments

@BenDevelopment
Copy link

BenDevelopment commented Oct 23, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

When a delay is added to an observable in a PipeTransform, the pipe returns always null.

Expected behavior

The pipe should returns the value returned by the observable.

Minimal reproduction of the problem with instructions

  1. Create a pipe returning an observable of string with a delay.
    See exemple:

https://stackblitz.com/edit/angular-gitter-tut9xq?file=app%2Fapp.component.ts

What is the motivation / use case for changing the behavior?

The pipe should return the observable string value instead of null. The point is to avoid ExpressionChangedAfterItHasBeenCheckedError in a specific case with a delay(0) in the pipe.

Environment


Angular version: 6.0.2


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [x] IE version XX
- [x] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

@BenDevelopment BenDevelopment changed the title Adding a delay to an observable pipe Adding a delay to an observable pipe returns always null Oct 23, 2018
@trotyl
Copy link
Contributor

trotyl commented Oct 23, 2018

Duplicate of #6696, #24133.

You are causing an infinite loop that never completes, scheduling new async task within template execution is not allowed.

@dawidgarus
Copy link

Change pipe to be pure and it will work

@BenDevelopment
Copy link
Author

BenDevelopment commented Oct 23, 2018

It works with a pure pipe thank you.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants