I am quite new to AngularJS and have the following problem: I have two select boxes which I fill with data that is stored in an external JSON file. I want to dynamically fill the second box depending on the item that was selected in the first box. Every item in the first box has a key called relation. I want to use the value of this key as a trigger for dynamically updating the items available in the second box.

Can anyone help me on this? I have already tried to write a function but it doesn't work. Thanx in advance.
This is the JSON structure:

```
{
"filterElements": [
    {
        "parameters": [
            {
                "paraName": "paraOne",
                "relation": "default"
            },
            {
                "paraName": "paraTwo",
                "relation": "default"
            },
    {
                "paraName": "paraThree",
                "relation": "defaultshort"
            }
        ]
    },
    {
        "relations": [
            {
                "defaultrelation": 
        [
                    "equals",
                    "does not equal",
                    "greater than",
                    "less than"
                ]
            },
            {
                "defaultshort": 
        [
                    "equals",
                    "does not equal"
                ]
            }
        ]
    }
]

```

}

[MyFiddle](https://jsfiddle.net/n7tgqbv5/)