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
});