Last active
July 23, 2016 15:49
-
-
Save StephenFluin/672b85faef772b8102457f4fe5dd02ce to your computer and use it in GitHub Desktop.
New App Module & Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppModule, enableProdMode, ApplicationRef } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { AmesAppComponent } from './ames.component'; | |
import { FORM_DIRECTIVES, FormsModule } from '@angular/forms'; | |
import { ROUTER_DIRECTIVES, provideRoutes } from '@angular/router'; | |
import { FIREBASE_PROVIDERS, defaultFirebase, firebaseAuthConfig, AuthMethods, | |
AuthProviders, } from 'angularfire2'; | |
import { disableDeprecatedForms, provideForms } from '@angular/forms'; | |
import { routes } from './routes'; | |
@AppModule({ | |
modules: [BrowserModule, FormsModule, RouterModule, FirebaseModule], | |
providers: [ | |
provideRoutes(routes), | |
{provide: FirebaseConfig, useClass: MyFirebaseConfig}, | |
], | |
precompile: [AmesAppComponent], | |
}) | |
export class MyAppModule { | |
constructor(appRef: ApplicationRef) { | |
appRef.bootstrap(AmesAppComponent); | |
} | |
} | |
// Manual configuration | |
class MyFirebaseConfig implements FirebaseConfig { | |
apiKey; | |
authDomain; | |
databaseURL; | |
storageBucket; | |
constructor() { | |
// Get parameters from environment | |
this.apiKey = ""; | |
this.authDomain = ""; | |
this.databaseURL = ""; | |
this.storageBucket = ""; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment