this.getData = function () {
$http.get("data/samples.json").then(function(d) {
console.log(angular.fromJson(d.data.cards)[0].title);
return angular.fromJson(d.data.cards);
});
};
this.cards = this.getData();
It prints the proper value to the console.
<p>{{main.cards[0].title}}</p>
It doesn't display anything, why?