1

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

1 Answer 1

1

I don't know if this can be helpful for you.

I've made a fiddle based on your code.

Please check this.

$scope.addPerson = function(personName){
    var obj = {};
    obj['name'] = personName;
    $scope.peopleArr.push(obj);
    $scope.personName = '';
};

Is this far from your intent?

Sign up to request clarification or add additional context in comments.

1 Comment

Ok I was doing it completely wrong... Today is gonna be a good day, thank you !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.