Skip to content

s-morgan-jeffries/angular-parse-interface

Repository files navigation

Build Status

A module for using Parse.com in AngularJS applications.

NB: This is pre-pre-alpha.

To use, either clone the repository, or do:

$ bower install --save s-morgan-jeffries/angular-parse-interface

Include both the ngResource source file and the built module file in your index.html:

<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-parse-interface/dist/angular-parse-interface.js"></script>

Then include the module as a dependency of your app module:

angular.module('yourApp', ['angularParseInterface']);

The module creates the parseInterface service, which has a single method: createAppInterface. Use it like so:

var appConfig = {
        applicationId: 'your-parse-app-ID',
        restKey: 'your-parse-REST-API-key'
    };
    
var appInterface = parseInterface.createAppInterface(appConfig);

The appInterface has four properties:

  • objectFactory: Call this with a className argument to create an angular Resource/Parse Object.
  • User: A special angular Resource decorated with signUp, signIn, signOut, and current (returns current user) methods
  • Query: A constructor that you call with a Resource argument and that returns a query builder.
  • getCloudCaller: A factory that takes a cloud function name and returns a function that will call the named cloud function asynchronously.
  • roleFactory: A factory that creates role objects that can be used for setting permissions.

I'll write clearer documentation when things are a little further along. In the meantime, feel free to look at the source code.

Forked! Again!

About

AngularJS module for using Parse.com's backend-as-a-service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages