O
O
ole922018-01-02 15:39:52
Angular
ole92, 2018-01-02 15:39:52

Angular + Friebase 4.8.0. What's wrong?

Hello everyone, help me understand. I will be grateful for any advice. Started learning Angular. Connected to the Firebase project. There is no authorization, you just need to get the data. On startup it shows the following errors:
ERROR in ../node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types /private'.
../node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot module find '@firebase/app-types/private'.

Did a downgrade of "firebase": "4.8.0" as described here: https://stackoverflow.com/questions/47949311/canno... Still the same error.
package.json
"angularfire2": "^5.0.0-rc.4",
"firebase"

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularFireModule } from 'angularfire2';
import { AngularFireDatabaseModule } from 'angularfire2/database';
import { environment } from '../environments/environment';
@NgModule({
imports: [
BrowserModule,
AngularFireModule.initializeApp(environment.firebase),
AngularFireDatabaseModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {}
app.component.ts
import { Component } from '
import { AngularFireDatabase } from 'angularfire2/database';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-root',
// templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
template: `
....html code
{{ item | json }}
....html code
`,
})
export class AppComponent {
private items: Observable;
constructor(db: AngularFireDatabase) {
this.items = db.list('items').valueChanges();
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question