Cannot find the 'property name' in angular 7 (Compile time error)












0














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.










share|improve this question



























    0














    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.










    share|improve this question

























      0












      0








      0







      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.










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      Aravind KR

      33




      33
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.



          enter image description here



          To get a forms value use e.g. this syntax:



          this.customer_addForm.value.cus_id


          Edit 1: res.status






          share|improve this answer























          • 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










          • 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










          • ` 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













          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          0














          You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.



          enter image description here



          To get a forms value use e.g. this syntax:



          this.customer_addForm.value.cus_id


          Edit 1: res.status






          share|improve this answer























          • 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










          • 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










          • ` 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


















          0














          You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.



          enter image description here



          To get a forms value use e.g. this syntax:



          this.customer_addForm.value.cus_id


          Edit 1: res.status






          share|improve this answer























          • 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










          • 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










          • ` 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
















          0












          0








          0






          You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.



          enter image description here



          To get a forms value use e.g. this syntax:



          this.customer_addForm.value.cus_id


          Edit 1: res.status






          share|improve this answer














          You should use an IDE that is capable to show you TypeScript errors. I can recommend IntelliJ and VS Code.



          enter image description here



          To get a forms value use e.g. this syntax:



          this.customer_addForm.value.cus_id


          Edit 1: res.status







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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 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










          • 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










          • 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










          • 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




















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          generate and download xml file after input submit (php and mysql) - JPK

          Angular Downloading a file using contenturl with Basic Authentication

          Can't read property showImagePicker of undefined in react native iOS