Angular noob here.
I have this plunker where there is a list. One item in the list has a flag symbol which opens a modal when clicked. The flag is applied to only one item in the list for which primary_program is set to true.
This is the format of my json file:
{
"student": 2773951,
"credits_completed": 26,
"academic_program_gpa": null,
"primary_program": true,
"academic_program": {
"id": 596,
"acad_program_category": 2,
"acad_program_type": 2,
"program_title": "Associate in Sciences Degree",
"required_credits": 60,
"min_gpa": 2.0,
"description": "",
"colleges": [
200,
300,
400,
500,
600,
700,
800
]
}
}
In the modal, i have the same list as a dropdown. When one program is selected, i want the app to change the value of primary_program to true for the selected to true and the rest of the list to false. How do i write a function to achieve this functionality? I tried using an ng-change() function. But it does not make any change to the json. How can i approach this issue?