Reputation: 25
I have a flow of three div working with each other (and 3 arrays) The idea is to select some options on the first div (from the first array), those options are passed inside the second one (and the second array).
I have an ng-repeat inside the second div which displays the selected options with, for each one, four radio buttons.
The radio buttons have an ng-click value which will add the option associated to the radio button value to the third array and will allow to sort the options by the different radio buttons checked.
DIV1 DIV2 DIV3
|option1| |option2| radio1 : option2
|option2| oradio1 oradio2 oradio3 radio3 : option4
|option3| --> |option4| -->
|option4| oradio1 oradio2 oradio3
The problem comes from my radio buttons, I've tried to change their name / values / ng-model change values for ng-values and I can't find a way to make it work. Either I have all my radio buttons changing at the same time or only on radio button line working at a time or all object having the radio value being updated...
I have an idea of what's going on, my scope is updating everything because my ng-model is the same or values are the same but I can't find a way to make it work...
I have spend my day on it... so it's time to get help :)
Here is a plunker of the code I have (I've made a lot of change like I said) but the idea is here...
http://plnkr.co/edit/jElDW1aUAv3k4cqou54y?p=preview
Thank you !
<EDIT>
The idea of option may not be very understandable just imagine you have some buttons for people Mary Chloe David etc.
The radio buttons are team bleu / red / yellow
I select the person I want in the first panel attribute them a team in the second one and display the person per team in the third one :)
Upvotes: 1
Views: 701
Reputation: 1069
I don't know if this can be helpful for you.
I've made a fiddle based on your code.
$scope.addPerson = function(personName){
var obj = {};
obj['name'] = personName;
$scope.peopleArr.push(obj);
$scope.personName = '';
};
Is this far from your intent?
Upvotes: 1