1
Ich habe ein Problem mit dem Lesen von Informationen aus JSON.AngularJs. Wie bekomme ich Objektinformationen von JSON
database.json:
{
"records":[
{
"Name":"Mehul",
"Age":"18"
},
{
"Name":"Alex",
"Age":"128"
}
]
}
controller.js:
this.$http.get('http://localhost:82/database.json').
then((data) => {
this.$scope.persons = data;
console.log(this.$scope.persons);
});
view.html:
<ul>
<li ng-repeat="person in persons">
{{ person.Name + ' : ' + person.Age }}
</li>
</ul>
In meinem Browser gibt es keine result.I get:
Wenn ich eine Linie in der Steuerung wie ändern:
this.$scope.persons = data.records;
ich:
Vielen Dank. Es klappt. – RuntimeException
als Antwort markieren, wenn es geholfen hat – Sajeetharan