首页 > 解决方案 > 更改 Metronic Angular 以使用 Firebase

问题描述

我一直在使用Metronic的角度版本来制作角度管理员。安装后,我将连接放在enviroment.tsenviroment.prod.ts上

npm install firebase @angular/fire --save

export const environment = {
  production: true,
  firebase: {
    apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxxxxxx.firebaseapp.com",
    databaseURL: "https://xxxxxxxxxxx.firebaseio.com",
    projectId: "xxxxxxxxxxx",
    storageBucket: "xxxxxxxxxxx.appspot.com",
    messagingSenderId: "xxxxxxxxxxx",
    appId: "1:xxxxxxxxx:web:xxxxxxxxxxxxxxxxx",
    measurementId: "xxxxxxxxxxxxx"
  }
};

正如文档所说,我还更改了文件中的行:

src/app/modules/_services/auth-http/index.ts

export { AuthHTTPService } from './auth-fake-http.service'; // You have to comment this, when your real back-end is done

export { AuthHTTPService } from './auth-http.service'; // You have to uncomment this, when your real back-end is done

并评论 app.module.ts 上的行

environment.isMockEnabled
      ? HttpClientInMemoryWebApiModule.forRoot(FakeAPIService, {
          passThruUnknownUrl: true,
          dataEncapsulation: false,
        })
      : [],

aldo 在 app.module.ts 我导入库

import { AngularFireModule } from '@angular/fire';

在 ngModules 上我插入:

AngularFireModule.initializeApp(environment.firebase),

但它仍然没有登录工作

有人知道我还需要做什么才能让它在 Metronic 角度管理版本上工作

感谢您的帮助

标签: angularfirebasefirebase-authenticationmetronic

解决方案


推荐阅读