I'm trying to understand how is handled the view updating in Angular. When I use a native asynchronous function and it callback updates a $scope variable, the view is not updated. But when I use an Angular asynchronous function, the view is updated properly. For example:
// Example 1: This code updates the store in view
$timeout(function() {
$scope.store = {
name: 'MyName'
}
}, 2000);
// Example 2: This code does not update the store in view
setTimeout(function () {
$scope.store = {
name: 'MyName'
}
}, 2000);
Why the second example does not update the store?