Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.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 我可以通过ng模型使用输入的值填充角度ng网格吗?_Javascript_Json_Angularjs_Angularjs Scope_Ng Grid - Fatal编程技术网

Javascript 我可以通过ng模型使用输入的值填充角度ng网格吗?

Javascript 我可以通过ng模型使用输入的值填充角度ng网格吗?,javascript,json,angularjs,angularjs-scope,ng-grid,Javascript,Json,Angularjs,Angularjs Scope,Ng Grid,这将基于对“Tim”Json数据的搜索正确填充静态Html表 var arrItem = []; angular.forEach($scope.items, function (item) { if(item.fname === enteredValue.firstName || item.lname === enteredValue.lastName ||item.address === enteredValue.address && item.

这将基于对“Tim”Json数据的搜索正确填充静态Html表

    var arrItem = [];
    angular.forEach($scope.items, function (item) {
    if(item.fname === enteredValue.firstName || item.lname === enteredValue.lastName
    ||item.address === enteredValue.address && item.phone === enteredValue.phone){
        arrItem.push({
            first: item.fname,
            last: item.lname,
            address: item.address,
            phone: item.phone

        });
现在我想把这些数据放在一个NG网格中。 这将尝试基于Tim搜索将此数据加载到NG网格中。我尝试了很多方法来做到这一点。现在,我尝试将arrItem分配给$scope.source并将其传递到getPagedDataAsync。有什么想法吗

  $scope.source= arrItem;
  $scope.getPagedDataAsync($scope.source, $scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); 

在定义gridOptions的控制器中,使用了错误的范围变量名称

 data: 'myData',
应该是

 data: 'source',