Let's say that when the page is first rendered, the controller has no data to return:
var data={};
function dataController($scope) {
$scope.resultsToDisplay = data;
}
but as the user works with the page in a variety of ways, information is being assembled "behind the scenes" and is getting appended to data
.
How does Angular know when to refresh the UI? Is Angular invoking dataController()
periodically? Is there anything special that has to be done to data
variable to tell Angular to "observe" it?