Jose
Jose

Reputation: 1239

AngularJS Display value

I have in my .html:

{{data}}

It will display:

[ { "images" : [ { "__v" : 0,
          "_id" : "542e57a709d2d60000c93953",
          "name" : "image1",
          "url" : "http://www.syll.com"
        },
        { "__v" : 0,
          "_id" : "543249050fcae2f082ca3e70",
          "name" : "imageOCR1",
          "url_image" : "http://meta-e.aib.uni-linz.ac.at/ocr.gif"
        },
        { "__v" : 0,
          "_id" : "543249050fcae2f082ca3e71",
          "name" : "imageOCR2",
          "url_image" : "http://www.textcreationpartnership.org/xxx.jpg"
        }
      ],
    "itemCount" : 70,
    "pageCount" : 7
  } ]

But I would like to display the value in "pageCount" so 7.

How I can do that without ng-repeat? btw, y controller works fine.

I tried:

{{data.pageCount}}

But it doesn't work.

Thanks!

[EDIT] changed with the righ JSON and formatted.

Upvotes: 1

Views: 1123

Answers (1)

net.uk.sweet
net.uk.sweet

Reputation: 12431

It looks like your data is all contained within a single-element array. Have you tried the following?

{{data[0].pageCount}}

Upvotes: 1

Related Questions