Pass a variable between components | Angular 7


I have an application that shows some categories for example the url of 1 category would be like that and the components would be CategoryComponent ... /

and I want that when you press a product from the category page send the product object with all the information to the next component that would be ProductComponent with the URL the information I do not want to pass or URL.

I hope to have explained myself well, thanks and best regards.

asked by Agustin Navarro 02.01.2019 в 17:07

1 answer


The solution you have taken is to establish in the database as a primary key a value that if you can pass through URL for example the name of the product, in this almost the name of the product is Scooter Extreme 5000 as the ID of this product as primary key is scooter-extreme-5000 and this is what happened by URL getting the URL I wanted and with the categories I do the same.

Greetings and thanks to all for the help.

answered by 03.01.2019 в 11:04