Sync

Backbone.sync ๋Š” ๋งค๋ฒˆ ๋ชจ๋ธ์„ ์„œ๋ฒ„์— ์ €์žฅํ•˜๊ฑฐ๋‚˜ ์ฝ์„ ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ํ•จ์ˆ˜์ด๋‹ค.(์„œ๋ฒ„์™€ ๋™๊ธฐํ™”)๊ธฐ๋ณธ์ ์œผ๋กœ RESTful JSON ์š”์ฒญํ•˜๊ณ  jqXHR๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ธฐ์œ„ํ•ด์„œ (jQuery/Zepto).ajax๋ฅผ ์ด์šฉํ•œ๋‹ค.

sync(method, model, [options]);
  • Method : CRUD("create", "read", "update", "delete")

  • model : Model์ด ์ €์žฅํ•˜๋Š” ์š”์ฒญ, Collection์„ ์ฝ๋Š” ๊ฒฝ์šฐ

  • options : success and error callbacks, and all other jQuery request options

์ฐธ์กฐํŽ˜์ด์ง€

Last updated