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'
我花了很多时间搞清楚什么是错的,但仍然没有任何线索..