Expose a javascript api with coffeescript

前端 未结 2 832
梦毁少年i
梦毁少年i 2020-12-31 07:36

I recently started using coffeescript and was curious what is the \"right\" way to expose an object that I create with Coffeescript to other javascript pages. Because of co

2条回答
  •  [愿得一人]
    2020-12-31 08:19

    Yep that's correct. Alternatively you can use define @myApi = { foo: -> } because this is window in the root context of the file.

提交回复
热议问题