Reputation: 651
actually i'm a backend developer so be gentle if my question is so dumb :)
I have an Backbone app initialized like this:
var AgendaApp = Mn.Application.extend({
onStart: function() {
...
...
var bookings = new Bookings();
bookings.startStream({
remove: false
});
}
var agendaApp = ...
As you see bookings istance is staying inside onStart function scope. There is no chance to access them using debug console. For example i want to run something like this:
agendaApp.bookings.fetch()
What frontend developers doing at these stiuations?
Upvotes: 0
Views: 26
Reputation: 48932
Make the model a property of the app, e.g. this.bookings = new Bookings()
. Then you can access it anywhere you have the app, e.g. agendaApp.bookings.fetch()
.
Upvotes: 1