2016-01-26 48 views
3

我正在使用backbone localstorage插件,但它給我下面的錯誤。Backbone.LocalStorage不是函數

Uncaught TypeError: Backbone.LocalStorage is not a function

我在我的收藏使用它在以下方式

var TodoList = Backbone.Collection.extend({ 
    model: TodoModel, 
    localStorage: new Backbone.LocalStorage('todos-backbone') 
}); 

我怎樣才能解決這個問題?

UPDATE

我將它們導入的index.html

<script src="node_modules/jquery/dist/jquery.min.js"></script> 
<script src="node_modules/backbone/node_modules/underscore/underscore-min.js"></script> 
<script src="node_modules/backbone/backbone-min.js"></script> 
<script src="node_modules/backbone-localstorage/backbone-localStorage.js"></script> 
<script src="js/models/todo.js"></script> 
<script src="js/collections/todos.js"></script> 
<script src="js/views/todos.js"></script> 
<script src="js/views/app.js"></script> 
<!-- <script src="js/routers/router.js"></script> --> 
<script src="js/app.js"></script> 
+0

請告訴我們的HTML,你導入的骨幹模塊 –

+0

是否有任何文件權限的問題? –

+0

@ErrHunter你是什麼意思的文件許可? – 2619

回答