angulr 2 services call c# web api

Mar 4 2017 8:58 PM
 my error:
 
OPTIONS http://localhost:57590/api/Employee/CreateEmployee 405 (Method Not Allowed)
e @ polyfills.js:3
t.scheduleTask @ polyfills.js:3
e.scheduleMacroTask @ polyfills.js:3
(anonymous) @ polyfills.js:3
send @ VM44:3
(anonymous) @ xhr_backend.js:117
Observable.subscribe @ Observable.js:56
Observable._subscribe @ Observable.js:114
MapOperator.call @ map.js:54
Observable.subscribe @ Observable.js:53
Employeeadd.register @ employeeadd.ts:28
View_Employeeadd0.handleEvent_20 @ /AppModule/Employeeadd/component.ngfactory.js:1148
(anonymous) @ view.js:408
schedulerFn @ async.js:94
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:74
NgForm.onSubmit @ ng_form.js:138
Wrapper_NgForm.handleEvent @ /FormsModule/NgForm/wrapper.ngfactory.js:31
View_Employeeadd0.handleEvent_20 @ /AppModule/Employeeadd/component.ngfactory.js:1146
(anonymous) @ view.js:408
(anonymous) @ dom_renderer.js:276
t.invokeTask @ polyfills.js:3
onInvokeTask @ ng_zone.js:227
t.invokeTask @ polyfills.js:3
e.runTask @ polyfills.js:3
invoke @ polyfills.js:3
localhost/:1 XMLHttpRequest cannot load http://localhost:57590/api/Employee/CreateEmployee. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. The response had HTTP status code 405.

Answers (1)