Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs ngtable内联编辑,can';不添加行?_Angularjs_Ngtable - Fatal编程技术网

Angularjs ngtable内联编辑,can';不添加行?

Angularjs ngtable内联编辑,can';不添加行?,angularjs,ngtable,Angularjs,Ngtable,让我的头绕着ng桌子的网格转。卡在如何添加新行的点上: $scope.addRow = function(add) { $scope.data.push(add) $scope.showAdd = false; }; 是否尝试将新对象添加到数据数组,但不起作用?这里怎么了 html: ID:{{add.ID} 名字: 说明: 电邮: 姓氏: 电话: 下面是一个plunkr ref:在addRow.html中,您正在添加变量“p”,该变量的计算结果始终为null。将此

让我的头绕着ng桌子的网格转。卡在如何添加新行的点上:

$scope.addRow = function(add) {
      $scope.data.push(add)
      $scope.showAdd = false;
};
是否尝试将新对象添加到数据数组,但不起作用?这里怎么了

html:


ID:{{add.ID}
名字:
说明:
电邮:
姓氏:
电话:

下面是一个plunkr ref:

在addRow.html中,您正在添加变量“p”,该变量的计算结果始终为null。将此更改为“添加”

e、 g

普朗克:

<table class="noborder">
    <tr>
        <td rowspan="2">ID: {{add.id}}<input type="hidden" name="id" value="{{add.id}}"></td>
        <td>Firstname:</td>
        <td><input type="text" name="fn" class="w100" ng-model="add.fn"></td>
        <td>Description: </td>
        <td>Email:</td>
        <td><input type="text" name="em" class="w180" ng-model="add.em"></td>
        <td><input type="button" value=" save " ng-click="addRow(p);"></td>
    </tr>
    <tr>
        <td>Lastname:</td>
        <td><input type="text" name="ln" class="w100" ng-model="add.ln"></td>
        <td><input type="text" name="dc" class="w180" ng-model="add.dc"></td>
        <td>Phone: </td>
        <td><input type="text" name="ph" class="w120" ng-model="add.ph"></td>
        <td><input type="button" value=" cancel" ng-click="cancelEdit()"></td>
    </tr>
</table>
ng-click="addRow(add);"