angularjs - Edit ng-repeated item using ngclick -


I am learning that angle and trying to make bits and bobs for learning. Ive tried to explain myself as far as possible - any help would be greatly appreciated.

Example:

I have made myself a bit of this data

  $ scope.people = [{"personID": 1, " "Alan", "Last name": "Van Shure", "Atting": "First name": "Sam", "Last name": "Stimpson", "Attting": false}, {"personID": 2, "First_name" : True}, {"person id": 3, "first_name": "Lindsay", "last_name": "van shoor", "present": wrong}];   

I have created an output in my view like this:

    

Now I'm stuck on that. I want to be able to click on a person and update my existing field on the wrong side. I think I can use ng-click like this

  $ scope.isAttending = function () {alert ("Attending"); };   

But there is no clue about how I will update the person who has clicked incorrectly to correct in $ scope.people. People

When I have achieved it, there will be another NG-repeat with a filter to show those people, but I am able to obey that part,

Can help or give me some advice, at this time nothing will be highly appreciated.

Thanks in advance.

I wrote an example what I am trying to do here:

You simply repeat the person & lt; A href = "" ng-click = "virtual (person)" & gt; and take the item to your handler system, so that you can update your property (well you can also see that inline, but it would be better to put the logic apart and place it in the controller Is what you originally did)

  $ scope.isAttending = function (person) {person.attending = true; };   

Just add a filter to both sections to show that both are participating and who are not.

  & lt; Div ng-repeat = "person in person: filter: {present: false} track by person. PersonID" & gt; & Lt; A href = "" ng-click = "toggle attendee (person)" & gt; {{Person.first_name}} {{person.last_name}} - {{person.attending}} & lt; / A & gt; & Lt; / Div & gt;   

and

  $ scope.toggleAttending = function (person) {person.attending =! Person.attending; };          / Strong>  and the population of <2> people.invited  and  people.attendance  in the list of 2 people.  
  Function Update People People () {$ scope.people.attending = []; $ Scope.people.invited = []; Angular (For each person, work (person) {$ circle.page [person. Application: 'be present': 'invited']. Push (person);}); }   

Or even better, you can pass IDs, indexes and positions in the method and leave the item out of an array Pull it and press it to the other.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -