I have the following AngularJS controller function which makes a JSONP request to a webservice, gets the data as a JSON file and assigns the values to scope variables which I show in the UI by AngularJS directives such as {{variableName}}. This function works fine when I run it on page load, however it does not update the view values when I call this as a function:

```
$scope.getData = function(id) {
    $http.jsonp( webServices.getData+'?callback=JSON_CALLBACK', config ).then( function ( response ) {
        $scope.data = response.data;
        if($scope.data.status == "ok") {

        $scope.data.receivedData = campaign.receivedData;

        }
    })
}

```

Can anybody give me a hint on how can I make this update the values in the view (form input controls) dynamically when the JSONP call returns the values? I read about $apply() but not sure where and how to use it.

Thanks.