I am making an application with Angular 2 on the client side and Node on the server side with MongoDB database.
The data that is stored in MongoDB is geographic data that is categorized by zones, each document has, among other things, a zone field that identifies it within a zone.
{ ..., zone: "R04",...}
The data that reaches Angular 2 through the API made in Node can be from one zone or another, depending on what the user is interested in.
The idea is that the user, when writing the URL, establishes the zone that interests him through a parameter, as follows:
www.dominio.com/zone/R04
In the example, the user indicates that he is interested in zone R04 .
My question is how to make the Angular application know that the user has made the request establishing a certain zone, in the case of the example zone R04, so that later the client application consults the Node API only data referring to the zone in question.
You must use Angular routing, the end user can enter the URL including the parameter, it is not necessary to load the application beforehand. Angular will process the request by loading the page linked to the routing (plus anything else it needs) and taking the supplied value. For more detail on how to use routing I suggest reading: https://medium.com/@yonem9/angular-how-data-pass-between-urls-1a9ec5d779ea