我试图延长(我的真实的例子非常相似)角xeditable -可编辑的行-在这里描述的例子: http://vitalets.github.io/angular-xeditable/#editable-row 或它的jsfiddle链接在这里: HTTP: //jsfiddle.net/NfPcH/93/
所以我有一个额外的列用于上传每个行/项目的文件.如果它可以只是类型文件的输入元素,那很好,但我打开其他解决方案.通常,我的专栏看起来像这样:
<td>
<span editable-text="template.description" e-name="description" e-form="rowform" e-required>
{{ template.description || 'empty' }}
</span>
</td>
Run Code Online (Sandbox Code Playgroud)
但是,现在我想添加我的自定义列,我尝试使用或不使用所有提到的属性的输入元素:
<td>
<input id="file"
accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
ng-show="rowform.$visible"
class="btn btn-default"
name="file"
type="file"
e-name="file"
e-form="rowform"
value="{{ user.file || 'empty' }}" />
</td>
Run Code Online (Sandbox Code Playgroud)
在任何情况下,当我执行此代码时,在尝试保存行后,我无法在我的角度控制器中获取 - file - value:
$scope.saveUser = function (data, id) {
//$scope.user not updated yet
angular.extend(data, { id: id });
angular.extend(data, { file: file });
return $http.post('/saveUser', data);
};
Run Code Online (Sandbox Code Playgroud)
我的 - 数据 - 对象在这里与所有其他属性,如 - 描述 - 但没有 - 文件 …