Cannot find the 'property name' in angular 7 (Compile time error)
I'm trying to integrate my backend api with frontend.I'm getting the following error.
Cannot find name 'cus_id'.
Cannot find name 'username'.
Cannot find name 'fullname'.etc
expect 'location and status ' all other property name is error.Error
Customer.component.ts
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
Customer.service.ts
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
I've searched for solution in web , but i didn't found one.i've no idea why it is showing not found.
typescript angular6 angular2-services
add a comment |
I'm trying to integrate my backend api with frontend.I'm getting the following error.
Cannot find name 'cus_id'.
Cannot find name 'username'.
Cannot find name 'fullname'.etc
expect 'location and status ' all other property name is error.Error
Customer.component.ts
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
Customer.service.ts
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
I've searched for solution in web , but i didn't found one.i've no idea why it is showing not found.
typescript angular6 angular2-services
add a comment |
I'm trying to integrate my backend api with frontend.I'm getting the following error.
Cannot find name 'cus_id'.
Cannot find name 'username'.
Cannot find name 'fullname'.etc
expect 'location and status ' all other property name is error.Error
Customer.component.ts
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
Customer.service.ts
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
I've searched for solution in web , but i didn't found one.i've no idea why it is showing not found.
typescript angular6 angular2-services
I'm trying to integrate my backend api with frontend.I'm getting the following error.
Cannot find name 'cus_id'.
Cannot find name 'username'.
Cannot find name 'fullname'.etc
expect 'location and status ' all other property name is error.Error
Customer.component.ts
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
Customer.service.ts
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
I've searched for solution in web , but i didn't found one.i've no idea why it is showing not found.
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
constructor(private fb: FormBuilder, private cs: CustomerService, private ps: ProductService) {}
ngOnInit() {
this.createForm();
this.showSuccess = false;
this.getProductList();
}
createForm() {
this.customer_addForm = this.fb.group({
username: [''],
cus_id: [''],
email: [''],
fullname: [''],
customer_currency: [''],
mobile_primary: [''],
website: [''],
country: [''],
location: [''],
city: [''],
postal_code: [''],
status: [''],
productList: ['']
});
}
submitcustomeraddForm() {
this.showSuccess = false;
this.allProducts = _.uniq[this.allProducts];
this.cs.addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList);
}
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
export class CustomerService {
uri = 'http://localhost:3000/customer';
constructor(private http: HttpClient) { }
addCustomer(username,
cus_id, email,
fullname, customer_currency,
mobile_primary, website,
country, location,
city,
postal_code,
status,
productList) {
const obj = {
username: username,
cus_id: cus_id,
email: email,
fullname: fullname,
customer_currency: customer_currency,
mobile_primary: mobile_primary,
website: website,
country: country,
location: location,
city: city,
postal_code: postal_code,
status: status,
productList: productList
};
return this.http.post(`${this.uri}/add`, obj).subscribe(res => console.log('done'));
}
typescript angular6 angular2-services
typescript angular6 angular2-services
asked 2 days ago
Aravind KR
33
33
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.
To get a forms value use e.g. this syntax:
this.customer_addForm.value.cus_id
Edit 1: res.status
i'm using VS code
– Aravind KR
2 days ago
At first i tried usingthis.customer_addForm.value.cus_id
,it didn't worked
– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log ofthis.customer_addForm.value
. What do you get?
– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945290%2fcannot-find-the-property-name-in-angular-7-compile-time-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.
To get a forms value use e.g. this syntax:
this.customer_addForm.value.cus_id
Edit 1: res.status
i'm using VS code
– Aravind KR
2 days ago
At first i tried usingthis.customer_addForm.value.cus_id
,it didn't worked
– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log ofthis.customer_addForm.value
. What do you get?
– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
add a comment |
You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.
To get a forms value use e.g. this syntax:
this.customer_addForm.value.cus_id
Edit 1: res.status
i'm using VS code
– Aravind KR
2 days ago
At first i tried usingthis.customer_addForm.value.cus_id
,it didn't worked
– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log ofthis.customer_addForm.value
. What do you get?
– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
add a comment |
You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.
To get a forms value use e.g. this syntax:
this.customer_addForm.value.cus_id
Edit 1: res.status
You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.
To get a forms value use e.g. this syntax:
this.customer_addForm.value.cus_id
Edit 1: res.status
edited yesterday
Aravind KR
33
33
answered 2 days ago
Can K.
42739
42739
i'm using VS code
– Aravind KR
2 days ago
At first i tried usingthis.customer_addForm.value.cus_id
,it didn't worked
– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log ofthis.customer_addForm.value
. What do you get?
– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
add a comment |
i'm using VS code
– Aravind KR
2 days ago
At first i tried usingthis.customer_addForm.value.cus_id
,it didn't worked
– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log ofthis.customer_addForm.value
. What do you get?
– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
i'm using VS code
– Aravind KR
2 days ago
i'm using VS code
– Aravind KR
2 days ago
At first i tried using
this.customer_addForm.value.cus_id
,it didn't worked– Aravind KR
2 days ago
At first i tried using
this.customer_addForm.value.cus_id
,it didn't worked– Aravind KR
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log of
this.customer_addForm.value
. What do you get?– Can K.
2 days ago
So you should do see red. Red means, won't work. In your ` submitcustomeraddForm()` make a console log of
this.customer_addForm.value
. What do you get?– Can K.
2 days ago
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
getting another error Property 'status' does not exist on type 'Promise<any>'.
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
` status: this.customer_addForm.value.status, productList: this.allProducts }; this.cs.addCustomer(data) .subscribe( (res) => { if (res.**status**) { this.showSuccess = true ; } else { console.log('error'); } }); `
– Aravind KR
yesterday
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945290%2fcannot-find-the-property-name-in-angular-7-compile-time-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown