Hi David Here's an example that iterates over the people in the main array, as well as the items in the salary array. It utilizes ng-model on number inputs for the example so you can enter them in by hand or use the arrow buttons.
I threw in some clones of the objects to show it working. http://plnkr.co/edit/vD8Ek7EjPMBELVIEznwv?p=preview -phil On Monday, March 31, 2014 4:54:48 PM UTC-4, David Duff wrote: > > Hi, > > I am posting the following json to my web api controller when the person > object is posted, I would expect to see person details, address details, > and salary details. The salary details are missing. > > [ > { > "Id": 5, > "AddressId": 5, > "Salutation": "Mr", > "FirstName": "Test", > "Surname": "Tester", > "Address": { > "Id": 5, > "PersonId": 5, > "AddressType": 1, > "AddressLine1": "1 Test Rd", > "AddressLine2": null, > "AddressLine3": null, > "Postcode": "T1 1TE", > "City": "TestTown" > }, > "Salary": [ > { > "Id": 1, > "PersonId": 5, > "Salary": 1004, > "CreatedDate": "0001-01-01T00:00:00" > } > ] > } > ] > > Salary is a list of salary objects within Person. If I wanted to update > the salary value 1004 how would I do this? I know I'm doing something > wrong. Person.Salary[0].Salary and Person.Salary['Salary'] I have tried. > I'm trying a simple add update example and this is the sticking point. > I'm trying to do this using ng-model. > > Thanks in advance > David > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
