In the below code I have a variable named $scope.name. By default it has value "Hello 1". After 5 seconds I have set setTimeout function which updates the value of $scope.name to "Hello 2".
The variable shows the change in debug mode. But the new value does not update to {{name}}. In other words it just show the old value "Hello 1" on the page, not "Hello 2" which is required.
Thanks for help in advance.
var quizApp = angular.module("quizApp",[]);
quizApp.controller("quizCtrl",function($scope){
$scope.name = "Hello 1";
function pAHL(){
$scope.name ="hello 2";
}
setTimeout(pAHL, 5000)
})