lxyuma / backbone-parse-sync

Backbone.js plugin for using parse.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

backbone-parse-sync

Backbone plugin for using parse.com

This plugin use parse Rest API (Not use javascript API).

Use for personal application or mock creation or hackason event.

Getting Started

before using

  1. you must regist parse.com
  2. you must create project
  3. check your ApplicationId and RestAPIKey in your settings(url may be https://parse.com/apps/your-project/edit#app_keys)

All steps are very easy! Please check parse.com

Downloads

Download the production version or the development version.

usage

First, you must configure applicationId and RestAPIKey(not js api).

So, you can use Parse when write useParse:true in model or collection.

This is example code.

<script src="dist/backbone-parse-sync.min.js"></script>
<script>
  // settings
  window.parseHeaders = {
    ApplicationId: "*****************************",
    RESTAPIKey: "*****************************"
  };

  // Model
  TestModel = Backbone.Model.extend({
    useParse: true,
    urlRoot: "/blogs" // this means using parse 'blogs' object
  });
  testObject = new TestModel();
  testObject.set({'name': 'test'});
  testObject.save();

  // Collection
  TestCollection = Backbone.Collection.extend({
    useParse: true,
    url: "/blogs",
    model: TestModel
  });
  new TestCollection().fetch();
</script>

Query

If you'd like to use parse query, you can add save options.

This plugin does not provide such function. :-)

License

Copyright (c) 2013 ryuma.tsukano
Licensed under the MIT license.

About

Backbone.js plugin for using parse.com

License:MIT License


Languages

Language:JavaScript 98.5%Language:CSS 1.5%