Javascript 如何在angular xeditable中应用更改事件
这是我的视图代码,我需要在更改事件中应用它Javascript 如何在angular xeditable中应用更改事件,javascript,angularjs,x-editable,Javascript,Angularjs,X Editable,这是我的视图代码,我需要在更改事件中应用它 <span editable-select="user.testtype" e-name="testtype" e-form="rowform" e-ng-options="s.id as s.type_name for s in testtypes"> {{ showTestType(user) }} </span> {{showTestType(用户)} 我在span内尝试了ng change,e-ng-change和
<span editable-select="user.testtype" e-name="testtype" e-form="rowform" e-ng-options="s.id as s.type_name for s in testtypes">
{{ showTestType(user) }}
</span>
{{showTestType(用户)}
我在span内尝试了
ng change
,e-ng-change
和onchange
,但这些都不起作用 这是x-editable站点的一个片段
var-app=angular.module(“app”、“xeditable”、“ngMockE2E”);
应用程序运行(功能(可编辑选项){
editableOptions.theme='bs3';
});
app.controller('Ctrl',函数($scope,$q,$http){
$scope.user={
id:1,
名称:“超级用户”
};
$scope.updateUser=function(){
console.log(此.$data)
返回$http.post('/updateUser',$scope.user);
};
});
//模拟`/updateUser`请求
app.run(函数($httpBackend){
$httpBackend.whenPOST(/\/updateUser/).respond(函数(方法、url、数据){
data=angular.fromJson(数据);
如果(data.name=='error'){
返回[500,'错误消息'];
}否则{
返回[200,{状态:'ok'}];
}
});
});代码>
div[ng app]{margin:50px;}
角度可编辑Onaftersave(引导3)
{{user | json}}
我们只能在输入文件上应用ng更改事件。请参阅官方文档@Rahul,这就是为什么它不是工作伙伴。那么你有什么建议来解决这个问题呢?