ERROR in src/app/home/home.component.ts(311,9): error TS2322: Type
'Response' is not assignable to type 'String'.
src/app/home/home.component.ts(311,9): error TS2322: Type
'Response' is not assignable to type 'String'.
Property 'padStart' is missing in type 'Response'.
src/app/home/home.component.ts(336,5): error TS2554: Expected 2-3
arguments, but got 1.
src/app/home/home.component.ts(348,5): error TS2554: Expected 2-3
arguments, but got 1.
src/app/home/home.component.ts(366,11): error TS2339: Property
'message' does not exist on type 'Response'.
src/app/home/home.component.ts(367,43): error TS2339: Property
'data' does not exist on type 'Response'.
出于以下错误原因的relvant代码块工作正常,它在我的浏览器中编译得很好。我可以忽略这些警告吗?如何通过忽略错误来构建?
//rnadom number generator
randomnumbergenerate() {
let urlSearchParams = new URLSearchParams();
urlSearchParams.append('mid', '91');
urlSearchParams.append('tabname', 'account');
urlSearchParams.append('fname', 'accountnumber');
urlSearchParams.append('fnameid', '2875');
this.http.post('http://localhost/example_org/Base/randomnumgenerate', urlSearchParams).subscribe(
data => {
this.randomNumber = data,
console.log(data);
},
error => {
console.log(JSON.stringify(error.json()));
}
)
}
这是另一个创造错误的功能。
//get Notification data
loadfeedend(){
let urlSearchParams = new URLSearchParams();
urlSearchParams.append('datatype', 'my');
urlSearchParams.append('lastnode', '1');
this.http.post('http://localhost/example_org/Base/getnotificationdata', urlSearchParams).subscribe(
data => {
this.notificationData = data,
console.log(data);
},
error => {
console.log(JSON.stringify(error.json()));
}
)
}
这是另一个创造错误的功能。
//get Notification count
getnotificationcount(){
this.http.post('http://zlocalhost/example_org/Base/getnotificationcount').subscribe(
data => {
this.notificationCount = data,
console.log(data);
},
error => {
console.log(JSON.stringify(error.json()));
}
)
}
这是另一个创造错误的功能。
//reset notification counter
resetnotificationcount(){
this.http.post('http://localhost/example_org/Base/resetnotificationcounter').subscribe(
data => {
console.log('reset done');
},
error => {
}
)
}
这是另一个创造错误的功能。
//notification icon click
notificationfetch() {
this.loadfeedend();
this.getnotificationcount();
this.resetnotificationcount();
}
这是另一个创造错误的功能。
//column name data load
loadcolumnname(moduleid) {
this.http.get('http://localhost/example_org/Base/newsetmainviewcolumndata?moduleid=91').subscribe(
data => {
if(data.message == 'Success') { //for set data in view select process
console.log('all data fetch done',data.data);
} else {
console.log('failure-->',data.desc);
}
},
error => {
console.log(JSON.stringify(error.json()));
}
)
这是另一个创造错误的功能。
this.http.get('http://localhost/example_org/Base/loadcolumnname?moduleid=91').subscribe(
data => {
if(data.message == 'Success') { //for set data in view select process
console.log('column fetch done',data.data);
} else {
console.log('failure-->',data.desc);
}
},
error => {
console.log(JSON.stringify(error.json()));
}
)
}
这是home.ts的一部分,其中大部分错误都是生成的。 现在可以尽快删除此错误。
除此之外,我非常渴望解决的另一个错误是
ERROR in Error during template compile of
'MaterialDesignFrameworkModule'
Could not resolve @angular/flex-layout relative to
C:/Users/salesneuronpc1/Desktop/salesneuronver4_prod/node_modules/angular2-json-schema-form/angular2-json-schema-form.d.ts..