duncansaunders.karaokecustomerapp
v1.0.11
Published
A variety of tools for our karaoke oriented app
Downloads
4
Readme
CustomerApp
This package is heavily based on firebase (as you can probably tell from the imports), so we assume you've gotten everything set up. Obviously it works for our database structure, etc., so almost certainly won't for yours. If firebase isn't working, check you've gotten everything set up in environment.ts, there's a lot of tutorials out there for that. Joe joe!
Usage:
When setting up a new project, use npm to install (an up to date version of ) @angular/fire, and this package.
Import the AngularFireModule and environment file with keys in app.module.ts, and initialise the firebase module with AngularFireModule.initializeApp(firebase), as usual. Do not put imports for any of the firebase databasing or storage in there, at least on this version of angular it throws unuseful errors.
In whatever file you want to use the service in, have: import {CrudService} from 'duncansaunders.karaokecustomerapp'; import {AngularFireDatabase} from '@angular/fire/database'; import {AngularFireStorage} from '@angular/fire/storage'; as you would expect. Then, in the constructor of that class, initialise instances of them like: constructor(public db: AngularFireDatabase, public af: AngularFireStorage){}
Then to initialise the crud (or whatever other export we add at some point), call: let crud = new CrudService(db, af);
Then call functions from the crud instance.