I am creating an application using mean stack. I need to create a advanced search feature for my application where schema can searched by various fields like firstname, lastname, etc. On clicking the search button I will use the below route to connect to the server.
$http.get('/search/' + $routeParams.searchdata)
now if I try to console log the searchdata I can get the fields that I entered in the search form. Eg: If I enter the first name and the email id I see in the console as
{"firstname": "Smith", "email": "smith@gmail.com"}
If I try to access searchdata.firstname I get undefined.
1) How can I access the fields entered in the search form?
2) There are many fields in the schema. How will I tell to search only the fields that were entered in the form?