I have a table in Laravel Blade which has initialized a value which i want to access in the controller so as to send to a function make an API call. Question is how i access the id sent
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));
};
}]
);
my blade code;
<div ng-controller="MyController" ng-init="id ='{!! $mycalls->id !!}'">
want to pass the id from above to the controller and view in in getRecipientCalls function...
solved by using the $scope
return TableState.renderTable($scope, tableState, MyCall.getRecipientPositions(tableState, $scope.id));
and remove the call in the properties;
app.controller('MyController', ['$scope', 'MyCall','TableState', function ($scope, MyCall,TableState) {