snapjay / ngCart

Really simple shopping cart for AngularJS
http://ngcart.snapjay.com
380 stars 236 forks source link

How to use "data" attribute? #95

Open GaboDot opened 7 years ago

GaboDot commented 7 years ago

I've been looking for a solution, I need to store the product img url so I can retrieve it in the cart list with "{{ item.getData() }}", how can I achieve this?

I tried different ways but none of them worked

`

          <h4>My Item #1</h4>
          <p> $10.99</p>
          <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data=img>Add to Cart</ngcart-addtocart>
      </div>`

`

      <h4>My Item #1</h4>
      <p> $10.99</p>
      <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data="item.img">Add to Cart</ngcart-addtocart>
  </div>`

`

      <h4>My Item #1</h4>
      <p> $10.99</p>
      <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data="img">Add to Cart</ngcart-addtocart>
  </div>`

Any ideas would be helpful, thanks!