kumara
kumara

Reputation: 937

angular 6 post method issue

I am trying to pass component to service file. I have an issue in my service file. The error said 'can not find name array'. please check attachment.

  updateInvoiceHeaderStatus(fileNameFormArray:Array<any> ,orgName: string,fromDate: string,toDate: string){
 return this.http.post(`${this.selectedfilenameurl}/${orgName}/${fromDate}/${toDate}`,fileNameFormArray)

}

enter image description here

Upvotes: 0

Views: 59

Answers (3)

Christian Vincenzo Traina
Christian Vincenzo Traina

Reputation: 10464

This is a style issue, not a compilation issue. It works fine, but your style configuration just doesn't accept it.

Try using any[] in place of Array<any>

Upvotes: 0

arpit sharma
arpit sharma

Reputation: 405

From angular 7 typescript 3.1 is introduced in core framework so you just need to check tslint.jsonarray-type in the rules of tslint.json

Upvotes: 1

Tiago Silva
Tiago Silva

Reputation: 2349

Are you using TSLint or Code Prettier extensions? because those are marking Array as an error due to not having a space bar after the ':' mark , anyways your code should run without a problem.

updateInvoiceHeaderStatus(fileNameFormArray: Array<any> ,orgName: string,fromDate: string,toDate: string){
 return this.http.post(`${this.selectedfilenameurl}/${orgName}/${fromDate}/${toDate}`,fileNameFormArray)

Upvotes: 0

Related Questions