Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbro-io/parse-angular
Utilities for working with Parse.com data and AngularJS
https://github.com/jbro-io/parse-angular
Last synced: 3 months ago
JSON representation
Utilities for working with Parse.com data and AngularJS
- Host: GitHub
- URL: https://github.com/jbro-io/parse-angular
- Owner: jbro-io
- License: mit
- Created: 2013-11-05T23:40:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-30T06:57:57.000Z (over 10 years ago)
- Last Synced: 2024-04-14T12:01:02.537Z (7 months ago)
- Language: JavaScript
- Homepage: http://www.jonathanbroquist.com/integrating-parse-data-with-ng-model-in-angularjs/
- Size: 212 KB
- Stars: 32
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-angular
Utilities for working with Parse.com data.Check out my [blog post](http://www.jonathanbroquist.com/integrating-parse-data-with-ng-model-in-angularjs/) for a more detailed walkthough.
## Create a new object
```
//create new contact record from string
$scope.newContact = new ParseObject('Contact', ['firstName','lastName','email']);/* OR */
//create new contact record from parse object instance
var Contact = Parse.Object.extend('Contact');
$scope.newContact = new ParseObject(new Contact(), ['firstName','lastName','email']);
```
We can now bind $scope.newContact to any directive with ng-model to modify or display the object properties.
```Save
```## Retrieving records
```
var query = new Parse.Query(Parse.Object.extend('Contact'));
ParseQuery(query, {functionToCall:'first'}).then(function(obj){
$scope.newContact = new ParseObject(obj, ['firstName','lastName','email']);
});
```
This creates a query to retrieve the first record from the Contact class. The returned object is then wrapped in an instance of my ParseObject function allowing the fields to be accessed via the object properties.