私は、firebaseでangular2seedadvancedに取り組んでいます。私のコンポーネントの中でFirebaseサービスを使用している間は動作しません。 angular2seedvancedのコンポーネントの内部でサービスを使用するにはどうすればいいですか?私はangular2seedのサービスをどのように使用するのですか
-
を次しています。
ここで私のコードファイルを添付します。エラー
this.databaseService.authenticateを取得
login.component.ts
import { Store } from '@ngrx/store'; import { BaseComponent } from '../../frameworks/core/index'; import { DatabaseService } from '../../frameworks/demoapp/services/database.service'; import { Component } from '@angular/core'; @Component({ moduleId: module.id, selector: 'demo-login', providers: [DatabaseService], templateUrl: './login.component.html', styleUrls: ['./login.component.css'] }) export class LoginComponent { constructor(private databaseService: DatabaseService) { } login() { this.databaseService.authenticate(); } }
import { Injectable, Inject, NgZone } from '@angular/core'; import { FIREBASE } from '../../demoapp/index'; @Injectable() export class DatabaseService { private database: any; private onSync: Function; private userID: string; constructor(@Inject(FIREBASE) firebase: any, private ngZone: NgZone) { console.log('Constructing DatabaseService'); // Initialize Firebase var config = { // your web config from Firebase console apiKey: "", authDomain: "", databaseURL: "", storageBucket: "" }; firebase.initializeApp(config); this.database = firebase.database(); }; public authenticate() { };
firebase.service.ts
は関数ではありません。
どうすればよいですか?どうすればこの問題を解決できますか?前もって感謝します。