0

Hello I am using angular 8 with angular fire, I have imported AngularFireModule and AngularFireDatabaseModule as well but when compiling it's throwing an error says:

Error:

enter image description here

These are my imports:

enter image description here

I am using firebase like this in services:

enter image description here

Please let me know where am I doing wrong or is it a bug. Thanks

2
  • It would be great if you put the next time code in snippets, not just screenshots. Commented Mar 10, 2020 at 8:33
  • noted, next time will follow this pattern thanks, man. Commented Mar 10, 2020 at 8:43

1 Answer 1

3

After installing the angularfire package:

ng add @angular/fire@next

To be able to use realtime database in your code, you should import firebase/database:

import { Component } from '@angular/core';
import { AngularFireDatabase } from '@angular/fire/database';
import 'firebase/database';

https://github.com/angular/angularfire/blob/master/docs/rtdb/lists.md

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, @peter-haddad it works. just imported firebase/database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.