i used evntbus to pass data between two components in the first one when i click on the button the function submitted is executed like this and i send array of object to the other component
submitted(){
this.products.push(this.product);
EventBus.$emit('prod', this.products);
}
and in the other component:
created(){
EventBus.$on('prod', function (productObject) {
console.log('event received!', userObject);
this.produc = productObject.products
console.log('The product: ', this.produc)
}.bind(this));
console.log('User outside eventbus:', this.produc);
}
the problem is that i can't access to objects passed with eventbus in second component can't any one help me ? the value of productobject is
productObjectto the console? are you sure it contains aproductsproperty or is it an array?this.products, notthis.product.