Angular2 forms Angular2没有命中Api

Angular2 forms Angular2没有命中Api,angular2-forms,Angular2 Forms,在这里,我试图从ang2点击我的Api为什么它不点击。即使是我的小提琴手也不会引起交通堵塞,请检查我的代码 constructor(private fb: FormBuilder, private _http: Http) { _http.get('http://localhost:40039/Api/Home/GetEmp').subscribe(result => { this.ctstArrayList = result.json(

在这里,我试图从ang2点击我的Api为什么它不点击。即使是我的小提琴手也不会引起交通堵塞,请检查我的代码

 constructor(private fb: FormBuilder, private _http: Http) {     
        _http.get('http://localhost:40039/Api/Home/GetEmp').subscribe(result => {
            this.ctstArrayList = result.json();
        }
        )}
    doSubmit(): Observable<Customer> {

              let headers = new Headers({ 'Content-Type': 'application/json' });
            let options = new RequestOptions({ headers: headers });
            return this._http.post('http://localhost:40039/Api/Home/SaveEmp', JSON.stringify(this.custobj), options)
                    .map(this.extractData)
                    .catch(this.handleError);        
            }  
constructor(私有fb:FormBuilder,私有http:http){
_http.get('http://localhost:40039/Api/Home/GetEmp)。订阅(结果=>{
this.ctstArrayList=result.json();
}
)}
doSubmit():可观察{
let headers=新的头({'Content-Type':'application/json'});
let options=newrequestoptions({headers:headers});
返回此。\u http.post('http://localhost:40039/Api/Home/SaveEmp,JSON.stringify(this.custobj),options)
.map(此.extractData)
.接住(这个.把手错误);
}  
这是我的html代码,我在这里实现了ngtoch和其他一些验证 Html代码

<form class="form-horizontal" novalidate (ngSubmit)="doSubmit()" [formGroup]="customerForm">

                <fieldset>
                    <div class="form-group" [ngClass]="{'has-error': (customerForm.get('EmpName').touched ||
                                                  customerForm.get('EmpName').dirty) &&
                                                    !customerForm.get('EmpName').valid }">

                        <label for="name">Name</label>
                        <input type="text" class="form-control" formControlName="EmpName" [(ngModel)]="custobj.EmpName" />
                        <span>Hell{{custobj.EmpName}}</span>
                        <span class="help-block" *ngIf="(customerForm.get('EmpName').touched ||
                                                         customerForm.get('EmpName').dirty) &&
                                                         customerForm.get('EmpName').errors">
                            <span *ngIf="customerForm.get('EmpName').errors.required">
                                Please enter your first name.
                            </span>
                            <span *ngIf="customerForm.get('EmpName').errors.minlength || customerForm.get('EmpName').errors.maxlength">
                                The first name must be longer than 3 and max6 characters.
                            </span>
                        </span>
                    </div>
   <button type="submit" class="btn btn-success btn-block" (click)="doSubmit(custobj)" [disabled]="!(customerForm.valid)">Submit</button>

名称
地狱{{custobj.EmpName}
请输入您的名字。
名字必须超过3个字符,最多6个字符。
提交

请提供一些有关服务器、端口和配置的信息,以便我能为您提供进一步的帮助。服务器端口号为40039,我正在我的笔记本电脑中开发它。您可以使用邮递员访问:“”?你能粘贴回复吗?谢谢