A firebase module for Ionic 2
npm install ion2-firebasenpm run build to build a local copy.
npm run publishPackage.
npm install ion2-firebase
npm link packages will not install properly with our webpack confing (something on our list). If you can't push private code to npm, other options are a private npm repo/npm enterprise, or npm install from a git repo.
src/app.module.ts:
typescript
import { FirebaseModule } from 'ion2-firebase';
@NgModule({
imports: [
FirebaseModule
`
Update src/app/app-config.ts:
`typescript
export const FIREBASE_CONFIG = {
apiKey: "",
authDomain: "",
databaseURL: "",
storageBucket: "",
messagingSenderId: ""
};
`
Update .gitignore:
`
src/app/app-config.ts
`
Update src/app/app.component.ts:
`typescript
import { FIREBASE_CONFIG } from './app-config';
import { FirebaseService } from 'ion2-firebase';
export class MyApp {
constructor(
firebaseService: FirebaseService
) {
firebaseService.init(FIREBASE_CONFIG);
``