jquery - execute SetTimeout or $timeout only on some action -
how can trigger either settimeout or $timeout on button click. right if put inside button click function getting executed on own not waiting click event trigger it.
$scope.btnclick = function () { settimeout(function () { $scope.close(); }, 1000) }
use $timeout instead of settimeout , use $scope.$apply() in "$scope.close()" function.
note: if want see changes in ui , may use $scope.$apply() in function. using console.log() doesn't prove words ;)
Comments
Post a Comment