首页 > Coffeescript this point not found

Coffeescript this point not found

Hi ,小弟我有如下的问题,参见注释:


class Redmine

    constructor:(host,pm_key)->
        @host=host
        @pm_key=pm_key

    Issues:(pid,cb)->
        list: ->
            limit=1000
            api="#{@host}/issues.json?project_id=#{pid}&key=#{@pm_key}"
            api=api.concat "&limit=#{limit}"
            api=api.concat "&assigned_to_id=me"
            api=api.concat "&sort=due_date:desc"
            # 这里@ 指向list 的function 域内,无法指向Redmine.
            # 提示,this.get is not a function
            # 有什么办法获取Redmine的this么?(除了变量持有传递的形式)   
            @get api,cb

谢谢~

【热门文章】
【热门文章】