0

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?

Phil
  • 107
  • 1
  • 8
  • possible duplicate of [Backbone Local Storage "undefined is not a function"](http://stackoverflow.com/questions/10867467/backbone-local-storage-undefined-is-not-a-function) – mu is too short Jan 06 '14 at 22:26

2 Answers2

0

Damn! It was just a stupid typo.

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

Not it works.

Phil
  • 107
  • 1
  • 8
0

Check that you're using the right syntax for the plugin because there are several Backbone Localstorage plugins with various initialisation methods.

Elise Chant
  • 5,048
  • 3
  • 29
  • 36