#Beginner
20 messages · Page 1 of 1 (latest)
Because there is no resource with the url http://localhost:4200/posts. What do you expect to happen when sending a POST request to that URL, and why?
i have made a json ,postman for API work yesterday but i think with the change of localhost everything has changed and throwing error
That doesn't answer my question. Do you understand that the server running on port 4200 is your Angular CLI server, and that this server is different from the backend server you might have which exposes your REST API?
Have you read the error message? What does it say? What don't you understand it what it says? What do you intend this code to do?
i m trying to put input val into template var, and then push template var value to a function
Also, an advice: when you have a new question, unrelated to this question, post it as a new question. Use a descriptive title for your question rather than "Beginner".
That doesn't answer any of my questions. And I have no idea of what you mean by "input val" or "template var".
You can't do that here because the input is inside an *ngIf. So your code is basically equivalent to the following TypeScript code:
if (!isEPSuccessSubmit) {
const testvar = ...;
}
doUpdateEmailPhone(testvar);
testvar is not accessible, because it's declared inside the if block
ooooo! thanks. 🤗
why i am doing this because my project will not got connected to database, since it gets executed to browser, not on server, so i am using server side languages to make API which connects with database and that we use in our framework
OK. So which port is your API server running on?
postman
Which port? I'm expecting a number. For example, the CLI server is running on port 4200. Which port is your server running on? Assuming this (https://learning.postman.com/docs/designing-and-developing-your-api/mocking-data/setting-up-mock/) is what you're using, what do you get when you copy the URL of the server (step 5 of the quick start)?
http://localhost:3000/seller yesterday was running on this port
So, if you have the server still running, you need to send your requests to that URL, not http://localhost:4200/posts. And if you don't have a server running anymore, then you need to have one. HTTP responses can't magically be obtained from nothing.