Skip to content

Instantly share code, notes, and snippets.

@StephenFluin
Last active July 23, 2016 15:49
Show Gist options
  • Save StephenFluin/672b85faef772b8102457f4fe5dd02ce to your computer and use it in GitHub Desktop.
Save StephenFluin/672b85faef772b8102457f4fe5dd02ce to your computer and use it in GitHub Desktop.
New App Module & Configuration
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