0

Take a look at my json here :

{
"cartItems": {
    "743919183": {
        "code": "743919183",
        "title": "Responsive Website Package",
        "url_image": "http://www.domain.com/someimage.jpg",
    }
}
}

I want to display the value of url_image, but hard to pass the objet after cartItems. FYI, that number 743919183 is dynamic, I cannot hard coded it in my script. That will be a problem when the value is change.

how do i do it in angularjs?

my progress so far :

<div class="list">
<a class="item item-thumbnail-left" ng-repeat="cart in viewCartItem" href="#">
  <span ng-repeat="item in cart">
  <img ng-repeat="obj in item" ng-src="{{obj.url_image}}">
  </span>
</a>

it will display the image , but it turn out messing with templates stylesheet. How do i do it correctly?

1 Answer 1

2

use this code:

$.each(chart.cartItems, function(key, value) {
  console.log(value);
  console.log(value.code)
  console.log(value.title)
  console.log(value.url_image)
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.