I have a defined a basic controller which has a function called setSector (at the bottom)

```
function AppCtrl ($scope) {
    $scope.sectors =
    {
        "Sector": [
            {
                "sectorDesc": "London and South East",
                "sectorCode": "LSE",
                "SectorPPM": {
                    "Total": "10329",
                    "OnTime": "9195",
                    "Late": "1134",
                    "CancelVeryLate": "206",
                    "PPM": {
                        "rag": "A",
                        "text": "89"
                    },
                    "RollingPPM": {
                        "trendInd": "-",
                        "rag": "R",
                        "text": "83"
                    }
                }
            },
            {
                "sectorDesc": "Long Distance",
                "sectorCode": "LD",
                "SectorPPM": {
                    "Total": "1383",
                    "OnTime": "1159",
                    "Late": "224",
                    "CancelVeryLate": "68",
                    "PPM": {
                        "rag": "R",
                        "text": "83"
                    },
                    "RollingPPM": {
                        "trendInd": "+",
                        "rag": "G",
                        "text": "92"
                    }
                }
            },
            {
                "sectorDesc": "Regional",
                "sectorCode": "REG",
                "SectorPPM": {
                    "Total": "5348",
                    "OnTime": "4678",
                    "Late": "670",
                    "CancelVeryLate": "196",
                    "PPM": {
                        "rag": "R",
                        "text": "87"
                    },
                    "RollingPPM": {
                        "trendInd": "=",
                        "rag": "R",
                        "text": "87"
                    }
                }
            },
            {
                "sectorDesc": "Scotland",
                "sectorCode": "SCO",
                "SectorPPM": {
                    "Total": "2026",
                    "OnTime": "1861",
                    "Late": "165",
                    "CancelVeryLate": "41",
                    "PPM": {
                        "rag": "A",
                        "text": "91"
                    },
                    "RollingPPM": {
                        "trendInd": "+",
                        "rag": "G",
                        "text": "94"
                    }
                }
            }
        ]
    }

    $scope.currentSector = null;

    $scope.setSector = function (sectorCode) {
        $scope.currentSector = $scope.sectors[sectorCode];
    };
}

```

which is called from my index file.

```
<html ng-app>
<head>
    <title>PPM Viewer</title>
    <script type="text/javascript" src="js/lib/angular.min.js"></script>
    <script type="text/javascript" src="js/lib/angular-resource.min.js"></script>
    <script type="text/javascript" src="js/controllers/app.js"></script>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
</head>

<body>
<div class="container" ng-controller="AppCtrl">
    <h1>PPM Dashboard</h1>
    <ul>
        <li ng-repeat="sector in sectors.Sector">
            <a href="" ng-click="setSector(sector.sectorCode)">{{sector.sectorCode}} - {{sector.sectorDesc}}</a>
        </li>
    </ul>

    <p>
        Current sector : {{currentSector.sectorDesc}}
        Current code : {{currentSector.sectorCode}}
    </p>

</div>

</body>

```

When you click on the sectors in the UL list, the name of the clicked on sector is supposed to appear at the bottom, but for some reason the function is not passing back anything.

I am sure it is due to needing to specify the $scope.sectors.Sector somewhere in the function. but nothing I try will work. I am still quite new to angular and scopes, and think that I need to force the scope to go to a deeper level.. just not sure how

Can anyone advise how I can make the function... function! =)

Many thanks