Search code examples
backbone.jsbackbone-local-storage

Cannot use Backbone.localStorage


I'm getting this error with FF: TypeError: Backbone.localStorage is not a constructor

This is the code:

app.MyCollection= Backbone.Collection.extend({
  model: app.TestModel,
  localStorage: new Backbone.localStorage("test-backbone")
});

Anyone has an idea why this doesn't work? Not even to add the storage?


Solution

  • Damn! It was just a stupid typo.

    The line should be: localStorage: new Backbone.LocalStorage("test-backbone") with an uppercase "L".

    Not it works.