Transform object in array

 socket.on('test-channel:Comanda\\Events\\EventName', function (message) { 
                $scope.mesa = message;
                console.log($scope.mesa);
            });

try $scope.mesa = message.data

try $scope.mesa = message.data;

$scope.mesa = message.data;

Thanks for replying but I tried the 2 ways and still get errors

$scope.mesa = message.data; you tried this and got clientOrderCtrl not defined??

try $scope.mesa = message.data and console.log($scope.mesa);

in your console [assuming that you have done console.log(message) ] you have an object with property data and value of data is an array. thats the reason i told you to use message.data.

"collection-repeat expected an array for 'mesa' "
and the array is in the the response.data.data in your case:

so try : $scope.mesa = message.data.data;
and it will work fine.

thanks for help problem was solved

1 Like

glad I could help :slight_smile: