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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -