Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

List index and change in content

$
0
0

@anubro wrote:

My html file is like:

<ion-item ng-repeat="item in notify">
<!-- <ion-item ng-repeat="item in notify" href="#/app/appointmentdetails/{{item.id}}"> -->
<p ng-if="item.status == 0">Pending</p>
<p ng-if="item.status == 1" >Approved</p>
<p ng-if="item.status == 2">Cancelled by Doctor</p>
<p ng-if="item.status == 3">Cancelled by You</p>
<p>{{item.content}}</p>
<ion-option-button class="button-assertive"
ng-click="cancel_appointment(item.id)">
Cancel Apppointment
</ion-option-button>
</ion-item>

I have this swipe list , with cancel appointment button which sends item.id to the cancel_appointment function , my controller.js is as below:

$scope.cancel_appointment = function ($data){
...
... //code for cancellation
$scope.items[$data].status = '3';
}

After cancelation , I want status changed of relative list element e.g. if I cancel "8" number appointment , where $item.id is 8, then this item's status should be "3" which means its status now its cancelled by user. I tried to use "$scope.items[$data].status = '3';" which I know is incorrect , how can I update and refresh value into the list, or Do I have to reload complete list again ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>