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
Php AngularJS检索在控制器中的刀片服务器上初始化的数据_Php_Angularjs_Laravel_Smart Table - Fatal编程技术网

Php AngularJS检索在控制器中的刀片服务器上初始化的数据

Php AngularJS检索在控制器中的刀片服务器上初始化的数据,php,angularjs,laravel,smart-table,Php,Angularjs,Laravel,Smart Table,我在Laravel Blade中有一个表,它初始化了一个我想在控制器中访问的值,以便发送给函数进行API调用。问题是我如何访问发送的id app.controller('MyController', ['$scope', 'MyCall','id','TableState', function ($scope, MyCall, id,TableState) { $scope.displayed = []; $scope.callServer = function callSe

我在Laravel Blade中有一个表,它初始化了一个我想在控制器中访问的值,以便发送给函数进行API调用。问题是我如何访问发送的id

app.controller('MyController', ['$scope', 'MyCall','id','TableState', function ($scope, MyCall, id,TableState) {

    $scope.displayed = [];

    $scope.callServer = function callServer(tableState)
    {
        return TableState.renderTable($scope, tableState, MyCall.getRecipientCalls(tableState, $scope.id));
    };

}]
);
我的刀片代码

<div ng-controller="MyController" ng-init="id ='{!! $mycalls->id !!}'">


要将id从上面传递到控制器并在getRecipientCalls函数中查看

使用$scope解决

return TableState.renderTable($scope, tableState, MyCall.getRecipientPositions(tableState, $scope.id));
并删除属性中的调用

app.controller('MyController', ['$scope', 'MyCall','TableState', function ($scope, MyCall,TableState) {