Hi,
I am trying to post data from angularjs2 to asp.net mvc controller.
The actual issue is that when I am trying with it then
See how am I trying ?
this is the typescript ---
save(company: Company): Observable<boolean> { let headers = new Headers({ 'Content-Type': 'application/json' }); this._http.post(this._postUrl, /*JSON.stringify(*/company/*)*/, { headers: headers }) .subscribe( (data) => { console.log('Response'); new Observable<true>() }, (err) => { console.log(err); new Observable<false>(); }, () => console.log('Complete') ); return new Observable<false>(); }
this is the call to this service function
onSignUpClicked(message: string): void { this._service.save(this.company).subscribe( res => console.log(res), error => this.errorMessage = <any>error );
When I am debugging it (typescript) then it shows
Now see when it takes the control in the server side (MVC controller action) then it doesn't fill that data in the c# class.
see the snip below
https://1drv.ms/i/s!AitLVJhHEke3gewZXrXatheLUUytcw
Kindly guide me.