Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.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
Javascript 如何访问节点js中的角度过滤器值_Javascript_Angularjs_Node.js - Fatal编程技术网

Javascript 如何访问节点js中的角度过滤器值

Javascript 如何访问节点js中的角度过滤器值,javascript,angularjs,node.js,Javascript,Angularjs,Node.js,我正在尝试使用req.body访问node js中的值,它在ng模型中,实际上我的ng模型有一个角度js过滤器,我需要使用req.body从node js的输入字段中获取过滤器值,我将我的ng模型代码片段粘贴在这里,请帮我解决 <input type="disable" ng-disabled="true" class="form-control" name="count" ng-model="table.fields | mysum"> 这将是您的D

我正在尝试使用req.body访问node js中的值,它在ng模型中,实际上我的ng模型有一个角度js过滤器,我需要使用req.body从node js的输入字段中获取过滤器值,我将我的ng模型代码片段粘贴在这里,请帮我解决

    <input type="disable" ng-disabled="true" class="form-control"
           name="count" ng-model="table.fields | mysum">

这将是您的DOM,您不能将筛选器应用于ng模型

<input type="disable" ng-disabled="true" class="form-control"
           name="count" ng-model="table.fields">

您不能将
ng model
与筛选器一起使用--
ng model
需要绑定到属性。@ExplosionPills您能告诉我如何在ng model中访问筛选器吗?我认为您应该
$watch
进行模型更改并更新模型值。我如何将其发送到node express like req.body以存储该值mysql table如果我想查看此字段,意味着我应该在我的watch$scope.$watch('table.fields[$index].item_count',function(){})中这样查看它;上面的是正确的吗
<input type="disable" ng-disabled="true" class="form-control"
           name="count" ng-model="table.fields">
$scope.table = {};
$scope.table.fields = $filter('mySum')($scope.table.fields);

//watch for updated value... .
$scope.$watch('table.fields', function() {
    //watch for changes and do something... 
});