push multiple data in array(select and disselect items in array)
<ion-content> <h1 class="h1 margin">Following</h1> <ion-row> <ion-col size="12" *ngFor="let data of followingdata" (click)="select(data)"> <div class="newcssbg" [ngStyle]="{'background-image': 'url(' + data.img + ')'}"> <div class="overlay"> <p class="innertext">{{data.text}} <ion-icon *ngIf="data.selected" style="color:#fff;float:right;" name="checkmark-circle-outline"></ion-icon> </p> </div> </div> </ion-col> </ion-row> </ion-content> <!-- [ngStyle]="data.selected && {'border': '2px solid green'}" --> ts select(data) { // this.followingdataarray.push(data); this.followingdata.map(e => { if(e.id==data.id){ ...
Comments
Post a Comment