Skip to content

Commit 7102fec

Browse files
committed
Retrieved products through HTTP
1 parent 3829152 commit 7102fec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ProductList.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
products: []
4242
};
4343
},
44+
created() {
45+
this.$http.get('http://localhost:3000/products')
46+
.then(
47+
response => response.json(),
48+
response => alert("error")
49+
)
50+
.then(products => this.products = products);
51+
},
4452
methods: {
4553
addProductToCart(product, quantity) {
4654
eventBus.$emit('addItemToCart', {

0 commit comments

Comments
 (0)