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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -