Can I put a timer on a .on('keyup' to cut down the number of updates?

Viewed 303

I have the following code working:

$wmdInput.on('keyup', function () {
    var rawContent = $wmdInput.val();
    scope.$apply(function () {
        ngModel.$setViewValue(rawContent);
    });
});

However it seems to slow down my entering of characters. Is there some way I could put a timeout on this so that all the data is saved but it just does not do it more than for example once every two seconds?

4 Answers
Related