Javascript 视图未更新为范围值更新

Javascript 视图未更新为范围值更新,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我想在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

我想在
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 />
$scope.StartSend = function (mkey) {
    //Start Sending
    DataTransaction.StopSend(mkey,1).then(function successCallback(response) {
        console.log(response.data);//gets update value to db
    })
    .catch(function errorCallback(err) {
        console.log(err);
    });
}

$scope.StopSend = function (mkey) {

    //Stop Sending
    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);
    });
}

$scope.StartSend=函数(mkey,msg){
//开始发送
msg.Status=msg.Status==1?0:1
DataTransaction.StopSend(mkey,msg.Status)。然后(函数successCallback(response){
console.log(response.data);//获取数据库的更新值
})
.catch(函数errorCallback(err){
控制台日志(err);
});
}

My Mirror ng bind template=“{{msg.Status==1?'Stop Sending':'Start Sending'}}”更新ng bind template(状态变量为小写字母,应为大写字母形式的状态)。我已经更新了example类=“{'fa-play':msg.Status==0,'fa-pause':msg.Status==1}”是的,它的工作就像一个符咒!非常感谢@MelzarMy高兴-玩得开心:)的副本。
<div class="panel panel-warning" ng-repeat="msg in message">
        <button type="button" ng-click="Send(msg.msgkey, msg)" class="start-sending btn btn-info btn-fill btn-sm" data-toggle="tooltip" data-original-title="Resume sending the message">
            <span><i class="fa" ng-class="{'fa-play': msg.Status == 0, 'fa-pause': msg.Status == 1}"></i></span>
            <span ng-bind-template="{{msg.Status == 1 ? 'Stop Sending' : 'Start Sending'}}">
        </button>
  <div />

$scope.StartSend = function (mkey, msg) {
    //Start Sending
    msg.Status = msg.Status == 1 ? 0 : 1
    DataTransaction.StopSend(mkey,msg.Status).then(function successCallback(response) {
        console.log(response.data);//gets update value to db
    })
    .catch(function errorCallback(err) {
        console.log(err);
    });
}