Skip to content

Instantly share code, notes, and snippets.

@Michaela-Davis
Last active April 7, 2017 16:21
Show Gist options
  • Save Michaela-Davis/ec06ebd04035b387411b4e64139ee66a to your computer and use it in GitHub Desktop.
Save Michaela-Davis/ec06ebd04035b387411b4e64139ee66a to your computer and use it in GitHub Desktop.
Angular CLI Commands
begin CONNECT to FIREBASE:
`npm install angularfire2 firebase --save` (installs angularfire2 and firebase, --save => updates dependencies in the project's package.json)
* ADD to src/tsconfig.json
"types": [ "firebase" ]
* CREATE src/app/api-keys.ts (but my Firebase credentials)
export var masterFirebaseConfig = {
apiKey: "xxxx",
authDomain: "xxxx.firebaseapp.com",
databaseURL: "https://xxxx.firebaseio.com",
storageBucket: "xxxx.appspot.com",
messagingSenderId: "xxxx"
};
* ADD to .gitingore
#Firebase credentials
/src/app/api-keys.ts
* ADD to src/app/app.module.ts
import { masterFirebaseConfig } from './api-keys';
import { AngularFireModule } from 'angularfire2';
export const firebaseConfig = {
apiKey: masterFirebaseConfig.apiKey,
authDomain: masterFirebaseConfig.authDomain,
databaseURL: masterFirebaseConfig.databaseURL,
storageBucket: masterFirebaseConfig.storageBucket
};
IN THE IMPORTS ARRAY
AngularFireModule.initializeApp(firebaseConfig)
In Firebase Rules change ".read" and ".write" to "true"
begin RETRIEVE from FIREBASE:
npm install -g angular-cli
npm install -g typescript
ng new beehave
npm install bower -g
* bower init (in project directory)(ONLY FOR NEW PROJECTS)
* npm install (for CLONED PROJECTS)
bower install bootstrap --save (in project directory)
ng serve (in project directory)
* `ng lint` (in project directory) this runs a linter that will help locate syntax errors
* apm install atom-typescrip` (installs package in Atom that takes away the endless gray in .ts files)
* `ng help` (for Angular CLI help)
ADD /bower_components to .gitignore
ng g class food.model
* COMMIT -m "create food model"
ng g component food-list
* COMMIT -m "create food-list component"
ng g component new-food
* COMMIT -m "add new-food component with form"
ng g component edit-food
* COMMIT -m "add edit-food component with form"
ng g pipe sugar-grams
* COMMIT -m "implement sugarGrams pipe"
ng g service album.service
* commit -m "implement album.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment