firebase.starter

0.1.8 • Public • Published

FireStarter

Build Status npm version Coverage Status

FireStarter is a very simple wrapper for angularFire and Geofire.

Installation & Setup

$ npm install firebase.starter --save
$ bower install firebase.starter --save

1.) Include FireStarter in your app dependencies.

angular.module("yourApp",['firebase.starter']);

2.) Define your root url in a config block using the setRoot method.

 
(function(){
    "use strict";
 
    angular.module("yourApp")
            .constant("YOURURL","https://your-firebase.firebaseio.com");
            .config(function(fireStarterProvider,YOURURL){
                 fireStarterProvider.setRoot(YOURURL);
            });
 
})();

3.) Inject fireStarter into your angular service.

 
(function(){
    "use strict";
 
    angular.module("yourApp")
     .factory("yourFactory", yourFactory);
 
     /** @ngInject */
     function yourFactory(fireStarter){
 
     }
 
})();

Usage

Firestarter can take up to three arguments

     fireStarter(type, path, flag);
  1. type: the specific API you want to access. Options include: "array","auth", "geo", "object", or "ref".

  2. path: the path of the child node you wish to create. This argument should be passed as an array of strings. However, if there is only a single item in the array, you can also just pass the argument as a string. Also, you do not need to pass a path argument if type is set to "auth".

  3. flag: if you already have a firebaseRef and simply want to wrap it in angularFire, then set the path argument to the given firebaseRef and set this argument to true, otherwise leave this argument blank.

Thanks!

The Geofire portion is largely due to Mike Pugh's awesome wrapper. Thanks!

Contributing

Yes, please. Below should get you setup.

$ git clone https://github.com/bpietravalle/fireStarter.git
cd fireStarter
$ npm i && bower i # install dependencies 
$ gulp test #run test suite once 
$ gulp test:auto #watch files and run tests continually 

Any pending tasks associated with this repo are tracked here.

Package Sidebar

Install

npm i firebase.starter

Weekly Downloads

1

Version

0.1.8

License

MIT

Last publish

Collaborators

  • bpietravalle