-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Integration with AngularFire2
Minko Gechev edited this page Sep 20, 2016
·
11 revisions
This page shows how to integrate angularfire2 (angularfire2@2.0.0-beta.2 & firebase@3.1.0) into the seed.
- Install angularfire2 and firebase:
npm install --save angularfire2 firebase @types/request @types/firebase
- Declare the types for the dependencies in
src/client/tsconfig.json
:
"types": [
"firebase",
"angularfire2",
"core-js",
"express",
"jasmine",
"node",
"protractor",
"systemjs"
]
- In
tools/config/project.config.ts
, inside the ProjectConfig constructor:
constructor() {
this.SYSTEM_CONFIG_DEV.paths['firebase'] =
`${this.APP_BASE}node_modules/firebase/firebase`;
this.SYSTEM_BUILDER_CONFIG.packages['firebase'] = {
main: 'firebase.js',
defaultExtension : 'js'
};
- Use angularfire2!
import { FIREBASE_PROVIDERS, defaultFirebase } from 'angularfire2';
/* other imports/code */
bootstrap(AppComponent, [
FIREBASE_PROVIDERS,
defaultFirebase({
apiKey: '<->',
authDomain: '<->',
databaseURL: '<->',
storageBucket: '<->',
})
]);