【发布时间】:2020-05-12 00:56:45
【问题描述】:
我正在尝试通过 API 调用实现页面源等待
public responseTop: Observable<any>;
this.responseTop = this.productSRV.topEquipments();
this.responseTop.toPromise().then(sucess => {
this.topEquipments = sucess['data'];
// console.log('eq');
// console.log(this.topEquipments);
this.newsletterForm.controls.recaptchaReactive.setValue(sucess['message']);
}).catch(error => {
console.log('Error!', error);
});
<ng-container *ngFor="let topEq of topEquipments;">
因为API调用了两次,怎么放|异步等待 SEO 的页面源 如果我把
<ng-container *ngIf="responseTop | async">
仍然不会在页面源中加载
【问题讨论】:
标签: angular rxjs angular7 url-routing angular-universal