File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 88 "test" : " npm run build; karma start" ,
99 "docs" : " typedoc --out docs/api/ --module commonjs --mode modules --name AngularFire2 src" ,
1010 "build" : " rm -rf dist; tsc" ,
11- "build_npm" : " rm -rf dist && ./node_modules/.bin/ tsc -p tsconfig.publish.es5.json && ./node_modules/.bin/ tsc -p tsconfig.publish.es6.json" ,
11+ "build_npm" : " rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json" ,
1212 "postbuild_npm" : " cp manual_typings/firebase3/firebase3.d.ts package.json README.md .npmignore dist/ && npm run rewrite_npm_package" ,
1313 "rewrite_npm_package" : " node --harmony_destructuring tools/rewrite-published-package.js" ,
1414 "build_bundle" : " cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js --moduleResolution node --emitDecoratorMetadata --experimentalDecorators" ,
Original file line number Diff line number Diff line change @@ -31,32 +31,37 @@ export class AngularFire {
3131}
3232
3333export const COMMON_PROVIDERS : any [ ] = [
34- provide ( FirebaseApp , {
35- useFactory : ( config : FirebaseAppConfig ) => {
36- return initializeApp ( config ) ;
37- } ,
38- deps : [ FirebaseConfig ] } ) ,
3934 // TODO: Deprecate
4035 provide ( FirebaseAuth , {
4136 useExisting : AngularFireAuth
4237 } ) ,
38+ {
39+ provide : FirebaseApp ,
40+ useFactory : _getFirebase ,
41+ deps : [ FirebaseConfig ]
42+ } ,
4343 AngularFireAuth ,
4444 AngularFire ,
45- FirebaseDatabase ,
45+ FirebaseDatabase
4646] ;
4747
48- function _getFirebase ( url : string ) : Firebase {
49- return new Firebase ( url ) ;
48+ function _getFirebase ( config : FirebaseAppConfig ) : firebase . app . App {
49+ return initializeApp ( config ) ;
5050}
5151
5252export const FIREBASE_PROVIDERS :any [ ] = [
5353 COMMON_PROVIDERS ,
54- provide ( AuthBackend , {
55- useFactory : ( app : firebase . app . App ) => new FirebaseSdkAuthBackend ( app , false ) ,
54+ {
55+ provide : AuthBackend ,
56+ useFactory : _getAuthBackend ,
5657 deps : [ FirebaseApp ]
57- } )
58+ }
5859] ;
5960
61+ function _getAuthBackend ( app : firebase . app . App ) : FirebaseSdkAuthBackend {
62+ return new FirebaseSdkAuthBackend ( app , false ) ;
63+ }
64+
6065/**
6166 * Used to define the default Firebase root location to be
6267 * used throughout an application.
You can’t perform that action at this time.
0 commit comments