I'm new to AngularJS. I have this code in my controller:
let timeout_ = false;
let TIMELAPSE_ = 2000;
vm.setId= function (id) {
$timeout.cancel(timeout_);
timeout_ = $timeout(() => { SearchService.setId(id), TIMELAPSE_});
};
In my template I use: ng-click="parent.setId(id)".
The timeout doesn't seem to work. Why?
setId()is executed?