Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addressed Comments
  • Loading branch information
ABradham committed Aug 1, 2023
commit bb945e86c56a1830d72a5a781a1bff8a42586cac
2 changes: 2 additions & 0 deletions firestore/angular-rewrite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Follow these steps to have a working version of the quickstart running with the
```bash
npm run populate-production
```

> **Note:** To ensure that the script runs as intended, make sure that you have correctly populated the `environemnt.prod.ts` file with your Firebase credentials.

## Support

Expand Down
4 changes: 2 additions & 2 deletions firestore/angular-rewrite/scripts/PopulateFirestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ import {
signInWithEmailAndPassword,
} from 'firebase/auth';

import { environment } from './environment.js';
import { projectConfig } from './environment.js';
import { data } from './MockRestaurantData.js';

const app = initializeApp(environment);
const app = initializeApp(projectConfig);
const auth = getAuth(app);
const db = getFirestore(app);

Expand Down
27 changes: 27 additions & 0 deletions firestore/angular-rewrite/scripts/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/** If connecting to a live Firebase project (one that you set up in the
* Firebase console) put your config vars into the `prod` field object here
* and change the `initializeApp` value in `app.module.ts` to `environment.prod`.
* Otherwise, leave untouched to enable connection to demo project and emulators.
*/

export const projectConfig = {
projectId: 'demo-friendly-eats',
apiKey: 'API_KEY_UNUSED'
}
4 changes: 2 additions & 2 deletions firestore/angular-rewrite/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
import { provideFirestore, getFirestore } from '@angular/fire/firestore';
import { provideFunctions, getFunctions } from '@angular/fire/functions';
import { provideStorage, getStorage } from '@angular/fire/storage'
import { environment } from 'src/environments/environment';
import { projectConfig } from 'src/environments/environment';
import { HomepageComponent } from './homepage/homepage.component';
import { RestuarantPageComponent } from './restuarant-page/restuarant-page.component';
import { MatIconModule } from '@angular/material/icon';
Expand Down Expand Up @@ -76,7 +76,7 @@ import { SignInModalComponent } from './sign-in-modal/sign-in-modal.component';
MatInputModule,
MatButtonModule,
BrowserAnimationsModule,
provideFirebaseApp(() => initializeApp(environment)),
provideFirebaseApp(() => initializeApp(projectConfig)),
FormsModule,
provideAuth(() => {
const auth = getAuth();
Expand Down
2 changes: 1 addition & 1 deletion firestore/angular-rewrite/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Otherwise, leave untouched to enable connection to demo project and emulators.
*/

export const environment = {
export const projectConfig = {
projectId: 'demo-friendly-eats',
apiKey: 'API_KEY_UNUSED'
}