I want to display this list, but I could not access town attribute.
How could I fix my pb?
{ "id":"1",
"name":"Hotel Ritz",
"address":[
{
"country":"France",
"town":"Paris",
}
],
"visited":true
}
{
"id":"2",
"name":"The Plaza",
"address":[
{
"country":"USA",
"town":"New York"
}
],
"visited":false
}
And what's the best method to display a checkbox to change the value of attribute visited? I tried this code but it does not work:
<ul class="hotel-list">
<li ng-repeat="hotel in hotels">
<span>{{hotel.name}}<span>
</li>
<ul>
<li *ngFor="let towm of hotel.address">{{address.town}}</li>
</ul>
</ul>