ДМ
Size: a a a
ДМ
DP
Π
Π
И
Вキ
Вキ
Вキ
Вキ
Вキ
M
this.queryField.valueChanges.subscribe(result => {
if(result.length > 0)
this.suggestions$ = this._wikipediaService.getArticles(result)
.pipe(map((response: any) => response[1]));
else
this.suggestions$ = EMPTY;
});
И
this.queryField.valueChanges.subscribe(result => {
if(result.length > 0)
this.suggestions$ = this._wikipediaService.getArticles(result)
.pipe(map((response: any) => response[1]));
else
this.suggestions$ = EMPTY;
});
M
this._wikipediaService.getArticles(value)
.pipe(takeUntil(this.destroy))
.subscribe((articles: any[]) => {
if(articles[0].length > 0){
this._wikipediaService.getImages(value)
.pipe(takeUntil(this.destroy))
.subscribe((images: any) => {
this.articles = this.generateCards(articles, images.query.pages);
})
}
M
S
this.queryField.valueChanges.subscribe(result => {
if(result.length > 0)
this.suggestions$ = this._wikipediaService.getArticles(result)
.pipe(map((response: any) => response[1]));
else
this.suggestions$ = EMPTY;
});
this.suggestions$ = this.queryField.valueChanges.pipe(
switchMap(result => {
if (result.length) {
return this._wikipediaService.getArticles(result).pipe(
map((response: any) => response[1]),
);
}
return of(null);
}),
)
S
this._wikipediaService.getArticles(value)
.pipe(takeUntil(this.destroy))
.subscribe((articles: any[]) => {
if(articles[0].length > 0){
this._wikipediaService.getImages(value)
.pipe(takeUntil(this.destroy))
.subscribe((images: any) => {
this.articles = this.generateCards(articles, images.query.pages);
})
}
ДМ