| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

「Angular Firebase 構築手順」の版間の差分

提供: MyMemoWiki
ナビゲーションに移動 検索に移動
47行目: 47行目:
 
$ ng add @angular/fire@next
 
$ ng add @angular/fire@next
 
$ npm install firebase @angular/fire --save
 
$ npm install firebase @angular/fire --save
 +
</pre>
 +
 +
===Angular Material===
 +
*https://material.angular.io/
 +
<pre>
 +
$ ng add @angular/material
 
</pre>
 
</pre>

2020年10月29日 (木) 23:36時点における版

| Angular | Firebase |

Angular Firebase 構築手順

Firebase Hosting に Angular を統合して Firestore に接続

Angular

  • project name : typea-info-service
$ npm install -g @angular/cli
$ ng new typea-info-service
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss               
 ]
CREATE typea-info-service/README.md (1035 bytes)
            :
$ ng serve

Firebase

  • 必要なモジュールなどを対話で選択
$ cd typea-info-service
$ firebase init

Config

Fire base condig01.png

Fire base condig02.png

Config 
export const environment = {
  production: false,
  firebase: {
    apiKey: '<your-key>',
    authDomain: '<your-project-authdomain>',// {project-id}.firebaseapp.com
    databaseURL: '<your-database-URL>',// https://{project-id}.firebaseio.com 
    projectId: '<your-project-id>',
    storageBucket: '<your-storage-bucket>',// {project-id}.appspot.com
    messagingSenderId: '<your-messaging-sender-id>'
  }
};

Angular Fire

$ ng add @angular/fire@next
$ npm install firebase @angular/fire --save

Angular Material

$ ng add @angular/material