Javascript ng单击无法识别表中的更改

Javascript ng单击无法识别表中的更改,javascript,angularjs,Javascript,Angularjs,我试图在中查看发送到函数cronSave(用户id、脚本id、cron格式)的值。问题是cron\u format是一个属性,该函数只显示表中初始化的值,而不显示更改。。 这是表格: <p id="demo">Display data here</p> <main> <table class="table table-bordered table-hover" ng-controller="tableCtrl"> <

我试图在
中查看发送到函数
cronSave(用户id、脚本id、cron格式)
的值。问题是
cron\u format
是一个
属性,该函数只显示表中初始化的值,而不显示更改。。 这是表格:

<p id="demo">Display data here</p>

<main>
    <table class="table table-bordered table-hover" ng-controller="tableCtrl">
        <thead>
        <th>user name</th>
        <th>script name</th>
        <th>cron format<span class="glyphicon glyphicon-question-sign"></span></th>
        </thead>
        <tbody>
            <tr ng-repeat="row in data">
                <td class="userName">{{row.user_id}}</td>
                <td class="scriptName">{{row.script_id}}</td>
                <td class="cronFormat"><span contenteditable="true" ng-repeat="l in letters(row.cron_format) track by $index">{{l}}</span><button class="save"  ng-click="saveCron(user_id,script_id,cron_format)">save</button></td>
        </tbody>
    </table>
</main>
因此,如果在第行中有一个用户将cron格式更改为
*/5***
,它仍将显示在
“demo”
*/2**5*


如何克服这个问题???

您将Jquery与AngularJS混合在一起,这是不推荐的

您正在更新innerHTML,但如果您使用Angular,则这不是执行操作的方式。相反,您需要使用
ng model
并对其进行更新:

<p id="demo">{{demoData}}</p>
编辑:不确定为什么会有这个跨度,但为了更改cronFormat,它也应该是
ng型号

我把它改成这个,它可以工作:

<td class="cronFormat"><input type="text" ng-model="row.cron_format"/><button class="save"  ng-click="saveCron(row.user_id,row.script_id,row.cron_format)">save</button></td>
保存

看看这个。

谢谢您的帮助,但是……它不会改变cron_格式的值不可用的事实updated@johnking很抱歉错过了,请查看编辑。
$scope.saveCron = function(userId,scriptId,cronFormat){
        var data = //format your "user_id=userId&script_id=scriptId&cron=cronFormat" 
                   //here inside an object
        $http.post("updateCronChange.php", data).success(function(data){
            $scope.demoData = userId + scriptId + cronFormat;
        });
    }
<td class="cronFormat"><input type="text" ng-model="row.cron_format"/><button class="save"  ng-click="saveCron(row.user_id,row.script_id,row.cron_format)">save</button></td>