Skip to content

Instantly share code, notes, and snippets.

@Hawksbillcat
Created October 29, 2018 10:40
Show Gist options
  • Save Hawksbillcat/113b46f12fa05e272c6d6c664f1fb3c0 to your computer and use it in GitHub Desktop.
Save Hawksbillcat/113b46f12fa05e272c6d6c664f1fb3c0 to your computer and use it in GitHub Desktop.
<ion-list >
<ion-item-sliding *ngFor="let todo of todoList; let i = index;" >
<!-- <button ion-item (click)="detail(i)"> -->
<button ion-item detail-none (click)="detail(i)" >
<span>{{ todo.des }}</span>
<ion-icon name="checkmark" item-end *ngIf="todo.clicked"></ion-icon>
</button>
<ion-item-options>
<button class="red" (click)="delete(i)">
<ion-icon name="trash"></ion-icon>
Delete
</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
<ion-buttons end >
<button (click)="restore()" ion-button icon-only ><ion-icon name="md-refresh"></ion-icon></button>
//------------------------------------------------------------------------------------------------------------------//
detail(index: number){
for(let i =0;i<this.todoList.length;i++){
if(i!=index){
//this.tisClicked[i]=false;
this.dp.get_confirm_array()[i].clicked=false;
}else{
this.dp.get_confirm_array()[i].clicked=true;
}
}
restore(){
let idd=this.dp.getNumber_index();
this.restoreArray=this.dp.get_confirm_array();
this.restoreArray[idd].clicked=false;
//this.dp.set_confirm_array(this.restoreArray);有無加入都沒差
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment