-
If you don't already have one, generate a new API key by following instructions at https://developers.google.com/maps/documentation/android-sdk/signup#quick-guide.
Note: Alternatively, you can access an existing project's key via Google Cloud Platform under APIs > Services > Credentials.
-
Write the key to
src/environments/.google-maps-config.ts
as follows:export const googleMapsConfig = { apiKey: 'YOUR_API_KEY', };
Where
YOUR_API_KEY
is your Google Maps API key.
-
Visit https://console.firebase.google.com and click "Add project".
-
Once your project is created, on the welcome page under "Get started by adding Firebase to your app", click the Web icon (
</>
). -
In Step 1, select "Also set up Firebase hosting for this app".
-
Accept defaults for remaining steps to return the main console page.
-
Click "1 app" and then click the gear icon next to your app name.
-
Scroll down to "Firebase SDK snippet" and select "Config".
-
Copy the text that appears in "const firebaseConfig..." into a new file in
src/environments/.firebase-config.ts
, prepending the keywordexport
to the file contents. The contents of the file should look roughly like this:export const firebaseConfig = { apiKey: 'soMeReallYlOngApIkeyWouLdGoHere123', authDomain: 'my-app.firebaseapp.com', databaseURL: 'https://my-app.firebaseio.com', projectId: 'my-app', storageBucket: 'my-app.appspot.com', messagingSenderId: '12345678', appId: '1:12345678:web:abc123etcetc', };
Create a file in environments/.backend-config.json
containing the following:
{
"offlineBaseMapSources": []
}
Install Node.js using nvm:
$ nvm install 13 && nvm use 13
Install ng CLI using npm:
$ npm install -g @angular/cli
Install required npm dependencies:
$ npm install
This last step will fail if you haven't yet following instructions above in [Add Google Maps API key](#Add Google Maps API key).
Run ng serve
for a dev server. Navigate to http://localhost:4200/. Add
project/<project_name>
as a suffix to the url to see an existing project interface
in your browser. Alternatively, go to http://localhost:4200/project/new for a
new project.
The app 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. Use the --prod
flag for a production build.
Run ng test
to execute run tests locally in Chrome using
Karma test runner.
Run ng e2e
to execute the end-to-end tests via
Protractor.
Run ng deploy
.
To get more help on the Angular CLI use ng help
or go check out the Angular
CLI README.