This demo project is to show how to use Firebase to host Angular app.
This project was generated with Angular CLI version 14.2.1. This project was generated with Firebase CLI version 9.23.0.
Create firebase project at: Firebase Console
Run npm install firebase
to install the latest SDK
To host your site with Firebase Hosting, you need the Firebase CLI (a command line tool).
Run npm install -g firebase-tools
command to install the CLI or update to the latest CLI version.
Open a terminal window and navigate to or create a root directory for your web app
Run firebase login
to log in via the browser and authenticate the firebase tool.
Run this command from your app's root directory:
Run firebase init
to initialize your project. The Firebase CLI will prompt you to select options about how to set up your project. Accept the defaults by pressing Enter for each prompt.
Run ng build
to build dist, then copy to public
Run xcopy .\dist\firebase-angular-app\*.* .\public
to copy from dist to public,
When you're ready, deploy your web app Put your static files (e.g. HTML, CSS, JS) in your app's deploy directory (the default is 'public'). Then, run this command from your app's root directory:
Run firebase deploy
to deply
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.