我是Angular中的新成員,但我知道在Jquery中工作,我將將某些函數轉換爲Angular指令時遇到了問題。有人可以幫我這個問題,這是我的jQuery函數將Jquery轉換爲角度指令
$('.spinner .btn:first-of-type').on('click', function() {
$(this).closest('.spinner').find('input').val(function(i, v) {
return parseInt(v, 10) + 1;
});
});
$('.spinner .btn:last-of-type').on('click', function() {
$(this).closest('.spinner').find('input').val(function(i, v) {
return parseInt(v, 10) - 1;
});
});
我知道,你能讓我完全回答, –