I want to hide and show the start / stop button (switch), as well as the status of the download button at first ng-repeat.
HTML:
<div class="panel panel-warning" ng-repeat="msg in message">
<button type="button" ng-show="{{msg.Status}} == 1" ng-click="StopSend(msg.msgkey)" class="start-sending btn btn-info btn-fill btn-sm" data-toggle="tooltip" data-original-title="Resume sending the message">
<span><i class="fa fa-pause"></i></span>
Stop sending
</button>
<button type="button" ng-show="{{msg.Status}} == 0" ng-click="StartSend(msg.msgkey)" class="start-sending btn btn-info btn-fill btn-sm" data-toggle="tooltip" data-original-title="Resume sending the message">
<span><i class="fa fa-play"></i></span>
Start sending
</button>
<div />
JS:
$scope.StartSend = function (mkey) {
DataTransaction.StopSend(mkey,1).then(function successCallback(response) {
console.log(response.data);
})
.catch(function errorCallback(err) {
console.log(err);
});
}
$scope.StopSend = function (mkey) {
DataTransaction.StopSend(mkey,0).then(function successCallback(response) {
console.log(response.data);/gets update value to db
})
.catch(function errorCallback(err) {
console.log(err);
});
}
$scope.Getmessages = function() {
DataTransaction.GetMessage(Instaid).then(function successCallback(response) {
$scope.message = response.data;
})
.catch(function errorCallback(err) {
console.log(err);
});
}
source
share