I cannot seen to be able to load in a json image if the key value is a number, it doesn't seem to matter if I call it in html text or ascii.
Here I use two different key foo and 200x150 that have the same image value
json:
$scope.items = [
{
"id": 1,
"name": "Location 1",
"items_image": {
"id": 101,
"image": {
"200x150": "http://placehold.it/200x150?text=num1",
"foo": "http://placehold.it/200x150?text=foo1"
}
}
}
loading foo as "foo": works
<img ng-src="{{item.items_image.image.foo}}">
loading foo as "foo": works
<img ng-src="{{item.items_image.image.foo}}">
loading 200x150 as "200x150": fails
<img ng-src="{{item.items_image.image.200x150}}">
loading 200x150 as "200x150": fails
<img ng-src="{{item.items_image.image.200x150}}">
How do I do this with numbers? I included an example: http://codepen.io/garrettmac/pen/wKOmoP
items.items_image.image['200x150']-- I'm not sure if JavaScript object keys can begin with a number, but it's apparently valid JSON.