Good people I have the following code
app.controller('lista', function($http){
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
//this.feriados = <?php echo json_encode($feriados->feriados); ?>;
this.feriados = {};
$http({
method: 'POST',
url: '../controllers/feriados.php',
data: "op=listaTodos"
}).then(function (respondse){
this.feriados = response.data;
console.log(this.feriados);
},function (error){
});
});
My problem is that in printing to the console the "holidays" appear, but if I do <div ng-controller="lista as l"> {{ l.feriados }}</div>
I see that the variable retains the {}
value.