0
有沒有一種方法(希望乾淨),我可以在這裏做同樣的事情,而不分配狀態值? 當if條件在同一行上時,我一直遇到if條件返回布爾值(而不是函數)的問題。把條件和函數調用放在一行
onItemChanged = (event,ui) ->
input_element = event.target
list_id = input_element.getAttribute('list_id')
state = if input_element.checked
onItemChecked //function of int -> nothing
else
onItemUnchecked //function of int -> nothing
state (list_id)