locked
Angular binding to form not show all binded values with ngModel RRS feed

  • Question

  • User956626884 posted

    HI,

    I am writing an angular page which is binding a object with alot of fields to a form with many input text field. It is strange but only the first two fields are binding with values while the rest of the fields are empty. I swap the 2nd and 3rd input fields and the 3rd input field value shows up in the 2nd row spot. The 2nd input field which has been moved to the third row is blank. I looked at the HTML code but I am not sure why?  I am learning angular and not sure why not all the input fields should show values. I only show 3 input fields but in my code I have more than 10 input rows  but only the first 2 are showing the binded values. Any help is appreciated.

    Update: I figured it out. With refreshed eyes, I noticed the error

    In my HTML, I was setting dual binding  and all my #name="ngModel". I had this for all my input fields. The #name needed to be unique.

    Saturday, November 17, 2018 7:43 PM

All replies

  • User61956409 posted

    Hi comicrage,

    Update: I figured it out. With refreshed eyes, I noticed the error

    In my HTML, I was setting dual binding  and all my #name="ngModel". I had this for all my input fields. The #name needed to be unique.

    Glad to hear that you solve the problem by yourself, and thanks for sharing the solution.

    If possible, you can share a detailed solution and mark it as answer, which could help other community members solve similar problem.

    With Regards,

    Fei Han

    Tuesday, November 20, 2018 5:41 AM
  • User1281381861 posted

    Question with a sample code so that others can track the issue is helpful.

    Friday, November 23, 2018 4:14 PM