vtoulemonde / cart_lab

Rails and Angular one page App to manage a cart of books
0 stars 0 forks source link

Number of items and total price of the cart do not initialize correctly #1

Open vtoulemonde opened 10 years ago

vtoulemonde commented 10 years ago

In file cart_lab / app / assets / javascripts / book_controller.js, line 27 to 37:

Initialization of this.total and this.itemCount do not work. The array this.items seems to be empty (size 0) but it is not when it is displayed on the view.

vtoulemonde commented 9 years ago

This issue is because when you call the server to get some data, you don't know when you will get the result. To be sure you have the result and use it, you have to use the function then() on the request.