使用某个函数是,参数是回调函数,可以在外面先定义这个函数,再把这个函数名放入参数中,但这样有个限制,必须先定义再使用:
像这种的就不行
var chart = Highcharts.chart('container', options);
var options:any={
};
//或
this.http.post(apiUrl+'/Profile/PostProfilePictureByIds',{
"profilePictureIds":profilePictureIds2
},httpOption).subscribe((res:any)=>{})
const httpOption = {
headers :new HttpHeaders({
'content-type':'application/json',
Authorization: 'Bearer ' + this.token,
})
}
要这样:
//更正
var options:any={
};
var chart = Highcharts.chart('container', options);
//更正
const httpOption = {
headers :new HttpHeaders({
'content-type':'application/json',
Authorization: 'Bearer ' + this.token,
})
}
this.http.post(apiUrl+'/Profile/PostProfilePictureByIds',{
"profilePictureIds":profilePictureIds2
},httpOption).subscribe((res:any)=>{})