$scope is undefined in post

Hello,
I dont know where the error is. the $scope works fine, but if the $scope is in a function it does not work outside the function
Pleas help me. Thanks

angular.module('Basis') .controller("basis",function($scope) {

     $.post("/modules/basis/basis.php",{alle:true}, function(response){

         console.log(response);
            data = angular.fromJson(response);
            if(data.status =="OK"){
                console.log("scope");
                $scope.genossen = data.result;
                console.log($scope.genossen); //WORKS FINE
            }else{

            }
    });
    console.log("status "+$scope.status);

    $('#basis').addClass("active");
    console.log("basis");
    $scope.query = {
        order: 'g_name',
        limit: 5,
        page: 1
    };

    console.log("genossen"+$scope.genossen); //UNDEFINED
});


1 Reply 1 reply marked as answer

MK Muthukrishnan Kandasamy Syncfusion Team December 14, 2020 07:35 AM UTC

 
Hi Damaris, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query, please refer to the below forums the similar problem discussed. 
 
 
 
 
If you are facing any issue with Syncfusion controls in your application. Please share some additional details it will be help us to provide you the prompt solution. 
 
  1. Share us the Syncfusion control’s rendering code block.
  2. If you face any script error in console window of the browser, then please share us those error screenshots.
  3. Share us the issue replicating sample.
  4. Share us the screen recorded video with issue replicating steps.
 
 
Regards, 
Muthukrishnan K 


Marked as answer
Loader.
Up arrow icon