Greetings, I am a new web developer and I have been tasked with creating a prototype Inventory Page using Angular2. Please bear with me as my code may not be perfect.
In the snippet below, you'll notice that we are calling our base back-end API ('?') from the EXAMPLEapi.service page. This call is then passed to an ngOnInit function within EXAMPLEapi.component to initialize the inventory on the page.
Once the initial inventory is loaded, users should be able to select various filtering values such as Min/Max Years, Mileage, colors, etc. These values are captured by the form in EXAMPLEapi.component.html and sent to the refreshInv() function in EXAMPLEapi.component. The function converts these values into parameters using URLSearchParams before making another call to the API.
The structure of the API allows us to simply append 'min_price=' at the end of the base URL to reflect changes in the inventory call.
However, despite receiving a successful status 200 network response when submitting the filters, the inventory does not load back onto the page. It remains blank for some reason.
EXAMPLEAPI.service.ts
// Code from EXAMPLEAPI.service.ts is provided here
EXAMPLE.component.ts
// Code from EXAMPLE.component.ts is shown here