Question

 var my_variables = {};

_.extend(my_variables,Backbone.Events);

my_variables.on("event_name",function(msg)
{
   alert("easy street"+msg);
});

proxy.on("all", function(eventName) 
{
  my_variables.trigger(eventName);
});

my_variables.trigger("event_name");

Im trying to follow the code by reading the documentation, as far as I understood the proxy.on event is supposed to be called every time any event gets triggered. On this code, I get the error message

"proxy is not defined"

how to fix this here is the spot on the documentation documentation on events!

Was it helpful?

Solution

The example code uses an example object (proxy) to do the call on..

For you to make it work you need to replace proxy with the name of your object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top