There is the following code:
class OrdersBySalonUpdater
sendRequestToUpdateOrders: ->
console.log('123')
startDate = transformDate($("#from_datepicker"))
endDate = transformDate($("#to_datepicker"))
businessId = $(".maininfo__datepickerwrap").attr("data-business-id")
url = "some url"
$.get url, (data) ->
@updateOrders(data.orders)
updateOrders: (orders) ->
$("#salon_stat_table tr").slice(1).remove()
$.each orders, (index) ->
console.log(orders[index])
But when I execute the following:
x = new OrdersBySalonUpdater()
x.sendRequestToUpdateOrders()
I got the message "TypeError: this.updateOrders is not a function". How can I fix it? What's the problem? Thanks.