我想将https://github.com/lipis/flag-icon-css与ionic-select和https://www.npmjs.com/package/ionic-selectable一起使用。安装软件包后,我尝试了许多方法,但仍然无法显示该标志。有人可以给我解释一下这些标志如何工作
ionic_select.html
<ion-select #select1 [(ngModel)]="selectedCode">
<ion-select-option *ngFor="let c of countries" value="{{c.flag}}{{c.code}}">{{c.flag}}{{c.name}}</ion-select-option>
</ion-select>
ionic_select.ts
countries: any = [
{
code: '+93',name: 'Afghanistan',flag: './assets/flags/af.png'
},
ionic_selectable.html
<ion-item>
<ionic-selectable
item-content
[(ngModel)]="port"
[items]="ports"
itemTextField="country"
[canSearch]="true"
(onChange)="portChange($event)"
</ionic-selectable>
<span class="flag-icon flag-icon-{flag}"></span>
</ion-item>
ionic_selectable.ts
class country {
public country: string;
public flag: string;
}
export class Classname {
ports: country[];
port: country;
this.ports = [
constructor(){
{
country: 'afghanistan',flag: './assets/flags/af.png'
},}