# firewire-angular

> firewire | a modular ecosystem for building firebase apps in express.

Latest version **1.0.7** (published 2016-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install firewire-angular
pnpm add firewire-angular
yarn add firewire-angular
bun add firewire-angular
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2016-03-21 |
| First published | 2016-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ben Clark |
| Maintainers | attack-monkey |
| Keywords | firebase, firewire, angular, angularfire |

## Links

- npm: https://www.npmjs.com/package/firewire-angular
- npm.io page: https://npm.io/package/firewire-angular

## Dependencies (2)

- [firebase](https://npm.io/package/firebase.md) ^2.4.1
- [angularfire](https://npm.io/package/angularfire.md) ^1.1.4

## Recent versions

- 1.0.7 (latest) — 2016-03-21
- 1.0.6 — 2016-03-21
- 1.0.5 — 2016-03-21
- 1.0.4 — 2016-03-21
- 1.0.3 — 2016-03-20
- 1.0.2 — 2016-03-18
- 1.0.1 — 2016-03-18
- 1.0.0 — 2016-03-18

## README

# firewire-angular | firebase + express + angular

_Use in conjunction with firewire - https://www.npmjs.com/package/firewire_

firewire + firewire-angular = no wait time for firebase data (providing read access is granted).

## how it works
* firewire loads firebase in node.js which is much much faster than client-side firebase load.  
* firewire-angular hardwires that data into angular so it doesn't need to wait for firebase on the client-side.
* It then loads firebase up and seamlessly switches the hardwired data to realtime data.

## install

_Follow instructions @ https://www.npmjs.com/package/firewire_

3. Install firewire-angular into your public node_modules `npm install firewire-angular --save`
4. Add these dependencies to your jade template (assuming that you're running npm3+)

        // npm 3+  should load firebase + angulafire + firewire-angular into /node_modules ... If using < 3 these directories will need to be altered.

        //- firebase
        script(src="/node_modules/firebase/lib/firebase-web.js")

        //- angularfire
        script(src="/node_modules/angularfire/dist/angularfire.min.js")
        
        //- firewire-angular
        script(src="/node_modules/firewire-angular/firewire.js")

## get Started

Paste this script into your jade template before your other scripts.

    //- load firewire object
    script.
        var fw = !{firewire};

In your angular app add the firewire module

    var app = angular.module('app', [
        "firewireModule"
    ]);

This will assign `fw` to `$rootScope.fw` allowing you to just use `{{fw.some.data}}` in your templates or `$rootScope.fw.some.data` in your js.

Remember to inject $rootScope into any controllers, services, etc. that you need to access $rootScope.fw

In the background firewire-angular is using angularfire (angular's bindings for firebase) so you can now do things like `ng-click = "fw.some.data.$save()"` right in your template to save data back to firebase.

## Adding arrays

firewire-angular exposes 2 services (fb and fbref).  
fb is your firebase url (eg. https://example.firebase.com) and fbref is your firebase reference to it.  
Furthermore $rootScope.fwMap contains your firebase data routes.

So you can use angularfire's $firebaseArray(fbref.child($rootScope.fwMap[childRoute]); to assign a firebase array to a firewire route.  
You'll just need to inject $firebaseArray and fbref into your controller (etc.)

## Auth, login screens, etc.

Check out https://www.npmjs.com/package/firewire-angular-auth

---
_Source: https://npm.io/package/firewire-angular · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
