백본 컬렉션을 사용하여 데이터베이스를 쿼리해야합니다. 나는 이것을 어떻게하는지 모른다. 나는 어딘가에 URL을 설정할 필요가 있다고 생각하지만, 나는 그것이 어디에 있는지 모른다. 나는 이것이 매우 기본적인 질문 일 것임에 틀림없지 만 사과하지만, CodeSchool.com에서 백본 과정을 밟았으며 아직도 어디서부터 시작해야할지 모른다. 백본 컬렉션이있는 데이터베이스 쿼리
이
내가 수집이 코드입니다 :var NewCollection = Backbone.Collection.extend({
//INITIALIZE
initialize: function(){
_.bindAll(this);
// Bind global events
global_event_hub.bind('refresh_collection', this.on_request_refresh_collection);
}
// On refresh collection event
on_request_refresh_collection: function(query_args){
// This is where I am lost. I do not know how to take the "query_args"
// and use them to query the server and refresh the collection <------
}
})
동기화 방법에 대한 공식 Backbone 설명서를 읽어 보시기 바랍니다. [link] (http://backbonejs.org/#Sync) – Ingro