Php AngularJS检索在控制器中的刀片服务器上初始化的数据
我在Laravel Blade中有一个表,它初始化了一个我想在控制器中访问的值,以便发送给函数进行API调用。问题是我如何访问发送的idPhp 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
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) {