我一直鼓励这一网络解决这一问题,这可能是一个次要问题。
我在一个卷宗中的职责:
public getHelpContent(question: string[]) {
let theHelp: any[] = [];
theHelp = this.mssqlService.getTheHelpAnswer(question);
console.log("THE HELP:", theHelp);
this.commentContent = theHelp ;
let foundContent: any[] = [];
for (let i = 0; i < this.commentContent.length; i++) {
let hitContent: string[];
hitContent = this.searchHelpItem(question, this.commentContent[i]);
if (hitContent) {
foundContent.push(hitContent);
iii
iii
return theHelp;
iii
木板服务功能。
getTheHelpAnswer(jsonObj: any): any {
let body = JSON.stringify(jsonObj);
console.log("BODY VAR: ", body);
return this.http
.post<any>(`${this.urlLocationiiinotification/TheHelp`, body)
.map((response: Response) => response.json())
.catch(this.handleError);
iii
和《促进繁荣的幸福宣言》......
private handleError(error: Response | any) {
let errMsg: string;
if (error instanceof Response) {
const body = error || ;
const err = JSON.stringify(body);
errMsg = `${error.statusiii - ${error.statusText || iii ${erriii`;
iii else {
errMsg = error.message ? error.message : error.toString();
iii
console.error(errMsg);
return Observable.throw(errMsg);
iii
The ERROR I GET on volume is this:
error TS2345: Argument of type string is not assignable 纽约总部parameter of type string[]
当我改变时:这里的任何东西都来自:
getTheHelpAnswer(jsonObj: any): any {
纽约总部
getTheHelpAnswer(jsonObj: any): Observable<any> { ...
这是我发现的错误:
ERROR in src/app/app-help-state-machine.ts(364,5): error TS2322: Type Observable<any> is not assignable 纽约总部type any[] .
Property includes is missing in type Observable<any> .
src/app/app-help-state-machine.ts(371,50): error TS2345:
Argument of type string is not assignable 纽约总部parameter of type string[] .
我不理解问题是什么。
附录1:
I forgot 纽约总部add the signature of the FUNCTION
public getHelpContent(question: string[]): any[] { ...
但我仍然这样做......
ERROR in src/app/app-help-state-machine.ts(364,5): error TS2322: Type
Observable<any> is not assignable 纽约总部type any[] .
Property includes is missing in type Observable<any> .
src/app/app-help-state-machine.ts(371,50): error TS2345: Argument of type string is not assignable 纽约总部parameter of type string[] .
附录2:
页: 1
见我回答我自己问题的解决办法。