Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nowzoo/nowzoo.firebase.utils

An Angular module with utilities for working with Firebase and angularfire.
https://github.com/nowzoo/nowzoo.firebase.utils

Last synced: 11 days ago
JSON representation

An Angular module with utilities for working with Firebase and angularfire.

Awesome Lists containing this project

README

        

# NowZoo Firebase Utilities

An [Angular](https://angularjs.org) module with
utilities for working with [Firebase](https://www.firebase.com/) and
[angularfire](https://github.com/firebase/angularfire).

- [Installation](#user-content-installation)
- [Usage](#user-content-usage)
- [API](#user-content-api)

## Installation
```
bower install nowzoo-firebase-utils --save
```

## Usage

In your HTML...:

```
//dependencies...

//nowzoo-firebase-utils...

```

In your app...

```
//declare the dependency...
angular.module('my.app', ['firebase', 'nowzoo.firebase.utils']);

//set the application reference with a URL...
angular.module('my.app')
.run(function(firebaseUtilities){
firebaseUtilities.setApplicationReference('https://.firebaseio.com/')
});

angular.module('my.app')
.controller('MyController', function($scope, firebaseUtilities){
$scope.options = firebaseUtilities.getObject('options');
});
```

## API

```
//Set the application reference with a url...
firebaseUtilities.setApplicationReference(url);

//Get the application reference...
firebaseUtilities.getApplicationReference ();

//Get a $firebaseAuth object...
firebaseUtilities.getApplicationAuth();

//Get a child firebase reference from the arguments
firebaseUtilities.childReference(path1, ...);

//Get a $firebaseObject from the arguments
firebaseUtilities.getObject(path1, ...);

//Get a $firebaseObject from a firebase ref
firebaseUtilities.getRefObject(ref);

//Get a $firebaseArray from the args
firebaseUtilities.getArray(path1, ...);

//Get a $firebaseArray from a firebase ref...
firebaseUtilities.getRefArray(ref);

```