As I embark on creating my first complete Angular application, I encountered an interesting quirk. The model I am working with has a data structure that looks like this:
{
id: "12345",
host: {
name: "someHostServer",
ip-addresses: [
"1.2.3.4",
"10.11.12.13"
]
}
}
When rendering a page and assigning this structure to 'data' in the context, it is done as follows:
ID: {{data.id}}
Host: {{data.host.name}}
IP Addresses:
<span ng-repeat="address in data.host.ip-addresses">
{{address}}<br />
</span>
The ID and host name display correctly, but the addresses do not appear. Is this due to the hyphen in 'ip-addresses'? If so, is there a simple way to transform the data? The data is fetched from a basic $resource
factory.