TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sonal malhotra
NA
410
51.9k
two topics in angular 2(not jjs) .
Jun 27 2019 4:14 AM
hi experts,
1) https://embed.plnkr.co/plunk/7ubJ3l .. that link is not showing for full code
so i m asking expert
here is code employyee sservice.ts.
DeleteEmployee(id) {
return this._http.delete(
'http://localhost:52467/Employee/Delete/' + id
);
}
ShowEmployee(id): Observable<Employee> {
return this._http
.get('http://localhost:52467/Employee/GetEmployee/' + id)
.map((response: Response) => <Employee>response.json());
}
as Above i cant found link like this
,http://localhost:52467/Employee/Delete/,get('http://localhost:52467/Employee/GetEmployee/
from where i got these link n what is code in these code ?
is this for vss code?? or is this for visual studio ? any idea for what to do for process of service/mvc?
2) i found another link http://www.advancesharp.com/blog/1215/angular-2-crud-with-web-api-2
here is code webapi method
[HttpPost]
[Route(
"api/Customer/SaveCustomer"
)]
public
IHttpActionResult SaveCustomer(Customer customer)
{
if
(customer.Id > 0)
{
var dbCustomer = db.Customers.FirstOrDefault(x=>x.Id == customer.Id);
dbCustomer.Name = customer.Name;
dbCustomer.Address = customer.Address;
dbCustomer.Phone = customer.Phone;
db.SaveChanges();
}
else
{
db.Customers.Add(customer);
db.SaveChanges();
}
return
Ok(customer.Id);
}
is this webapi for visual studio ?
that link is saying it is for vs code only .. is it true? or can i use both vscode or vs ?
i cant do anything without www.c-sharpcorner.com. so i need help for step to step demo source code
Reply
Answers (
4
)
Angular + web api firebase hosting
Why we need Python 2.7 for the Angular Project ?