Вы можете сделать это, как показано ниже.
HTML
<ion-content padding>
<ion-list *ngFor="let itm of shippingdetails">
<ion-item-divider>
<ion-checkbox slot="end" checked="{{itm.isChecked}}" (ionChange)="selectCP($event, itm)"></ion-checkbox>
<ion-label>
<h2>{{itm.name}}</h2>
<p>{{itm.mobile}}</p>
</ion-label>
<button ion-button outline item-end>
<ion-icon name="create"></ion-icon>
</button>
<button ion-button outline item-end>
<ion-icon name="trash"></ion-icon>
</button>
</ion-item-divider>
</ion-list>
</ion-content>
TS
import { Component } from '@angular/core';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
shippingdetails: any = [];
constructor() {
this.shippingdetails = [
{ name: 'Raghav', mobile: '0771111111', isChecked: false },
{ name: 'Rahul', mobile: '0772222222', isChecked: false },
{ name: 'Virat', mobile: '0773333333', isChecked: false },
{ name: 'Sanga', mobile: '0774444444', isChecked: false },
];
}
selectCP(event, item) {
if (event.checked) {
this.shippingdetails.forEach(shpItm => {
if (shpItm.name === item.name) {
shpItm.isChecked = true;
} else {
shpItm.isChecked = false;
}
});
}
if (!event.checked) {
this.shippingdetails.forEach(shpItm => {
if (shpItm.name === item.name) {
shpItm.isChecked = false;
}
});
}
}
}
Я думаю, что это будет полезно.найти рабочую демо здесь