jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.39k forks source link

Missing parenthesis in documentation's code sample for preinitialize on Collections #4237

Closed binlabs closed 3 years ago

binlabs commented 4 years ago

There is a closing parenthesis missing on line 1897 of index.html. It's a code example in the documentation for using preinitialize on Collections.

Current

class Library extends Backbone.Collection {
  preinitialize() {
    this.on("add", function() {
      console.log("Add model event got fired!");
    }; // Missing parenthesis on this line
  }
}

Fix

class Library extends Backbone.Collection {
  preinitialize() {
    this.on("add", function() {
      console.log("Add model event got fired!");
    });
  }
}
josegonzalez commented 3 years ago

This can be closed.