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

product-list.component.ts #6

Closed
VZhyrytskiy opened this issue Apr 5, 2018 · 1 comment
Closed

product-list.component.ts #6

VZhyrytskiy opened this issue Apr 5, 2018 · 1 comment

Comments

@VZhyrytskiy
Copy link

Не понял предназначение вот этой функции
resolveFn: Function|null = null;

@RomanKhomenko
Copy link
Owner

это единственный способ найденный мной, чтобы использовать промайсы и async pipe вместе.
В моей первом варианте использования, было так:
getProducts() { this.productService.getProducts() .then(resp => new Promise(...) }
Это порождало новый промайс - async pipe срабатывал и ничего не работало. issue
Собственно решение не создавать каждый раз новый промайс, а резолвать существующий. поэтому и нужна ссылка на функцию резолвер. Взял с сайта доков ангуляра. see example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants