Check out example codes for "$scope.$apply". It will help you in understanding the concepts better.

Code Example 1

$scope.$apply(function () {

    // Add $scope.myVariableHere = value

});

Learn ReactJs, React Native from akashmittal.com