한국어로 보기

Angular2(RC5) & Firebase(Angularfire2) Scaffolding (unofficial)

This is a scaffolding for Angular2 & Firebase(Andgularfire2) project. And It includes some example codes (routes & firebase Goole authentication & firebase database).

Composed of


DEMO

https://angularfire2scaffoling.firebaseapp.com

Snapshot

alt


0. Prerequisites

Node 6.0+

Webpack of Angular-CLI@webpack.beta11 requires node 6.0+. You can download it from http://www.nodejs.org .

NPM 3.0+

Angular-CLI@webpack.beta11 requires NPM 3.0+.

npm install -g npm@latest

Typescript 2.0.0+

Angular-CLI@webpack.beta11 requires Typescript 2.0.0+.

# This will install typesctipt@2.0.0+
npm install -g typescript@next
# Install typings globally
npm install -g typings

Angular-CLI beta11 (support RC5)

npm install -g angular-cli@webpack

You could get errors about typescript version, but you can ignore it because it is from Angular-CLI issue.

Angular-CLI Ref: https://github.com/angular/angular-cli

Firebase set up

  1. It needs your FirebaseApp-info including apiKey to connect your Firebase
  2. If you don't have firebase account, create it from https://firebase.google.com/
  3. Make your firebase project, then you can get your FirebaseApp-info including apiKey in your Firebase Console. It needs set the file /app/firebaseconfig.ts.

Firebase Ref: https://firebase.google.com/docs/web/setup


1. Install

  1. Download or Clone

  2. Install npm packages

# in the project folder
npm install
# if you got 'node-gyp error', then install node pakages again with '--no-optional'
npm install --no-optional 
  1. Init typings
# This command will create typings.json
typings init

2. Firebase Sets Up

  1. Rename /app/firebaseconfig.sample.ts to /app/firebaseconfig.ts

  2. Put your FirebaseApp-info like apiKey into the file /app/firebaseconfig.ts

// /app/firebaseconfig.ts
export class FirebaseConfig {
   public static get CONFIG_DATA(): any {
        return ({
            apiKey: "<your-key>",
            authDomain: "<your-project-authdomain>",
            databaseURL: "<your-database-URL>",
            storageBucket: "<your-storage-bucket>"
        });
    }
}

3. Run

ng serve

Angular-CLI Ref: https://github.com/angular/angular-cli