1
我正在學習用木偶和Rails骨幹作爲後端,使用截屏和我堅持了這個錯誤:木偶:未捕獲的ReferenceError
Uncaught ReferenceError: FooterApp is not defined
我app.js.coffee代碼:
@Demo = do (Backbone, Marionette) ->
App = new Backbone.Marionette.Application
App.addRegions
headerRegion: "#header-region"
mainRegion: "#main-region"
footerRegion: "#footer-region"
App.addInitializer ->
App.module("FooterApp").start()
#App.execute "footer:show"
App.on "initialize:after", ->
if Backbone.history
Backbone.history.start()
App
footer_app.js.coffee
@Demo.module "FooterApp", (FooterApp, App, Backbone, Marionette, $, _) ->
@startWithParent = false
API =
showFooter: ->
FooterApp.Show.Controller.showFooter()
FooterApp.on "start", ->
API.showFooter()
和show_controller.js.coffee
@Demo.module "FooterApp.Show", (Show, App, Backbone, Marionette, $, _) ->
Show.Controller =
showFooter: ->
console.log 'test'
我花了很多時間搞清楚什麼是錯的,但仍然沒有任何線索..