【发布时间】:2014-07-29 18:33:58
【问题描述】:
我正在研究 Backbone,使用 Marionette 和 Rails 作为后端,使用截屏视频,我遇到了这个错误:
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'
我花了很多时间找出问题所在,但仍然没有任何线索..
【问题讨论】:
标签: backbone.js coffeescript marionette