New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

firewire-angular

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firewire-angular

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

latest
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

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

  • Install firewire-angular into your public node_modules npm install firewire-angular --save

  • 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

Keywords

firebase

FAQs

Package last updated on 21 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts