我有一个客户ID,每个客户都有不同的徽标。现在我不知道如何用角度来显示徽标。
这是我未完成的代码:
logo: string;
companyName: string;
ngOnInit() {
this.currentLang = this.translate.getDefaultLang();
this.languages = this.translate.getLangs();
this.activatedRoute.queryParams.subscribe((params: Params) => {
const customerId = params["customerId"];
if (customerId) {
this.userService.getCustomer(customerId)
.subscribe(customer => {
this.logo = customer.logo, this.companyName = customer.name
});
}
});
}
在这里,我要显示选定的徽标:
<div class="logo">
<span class="logo-type"><img src="{{ customer.logo }}"></span>
</div>