Adding Firebase to Angular 2 Heroes Tutorial

I am trying to connect firebase to an angular2 tour of John Papa's hero book and I cannot figure out how to do this.

I tried to follow and implement jeffbcross in my angular2 example here , but I can't get it to work. I am trying to create a simple example of angular2 and firebase playing well together, and it would be great if I enabled OAuth. Does anyone know how to connect this or have a repo?

Having tried using the jeffbcross example, I am stuck here: github.com/LukeSchlangen/heroesOfFirebase I could not get all the links and the import. In particular, import * as Firebase from 'firebase'; will continue to show that I have 'firebase' as undefined, which makes sense because I never exported it, but I don’t know where to export it.

(In case this helps, I use Visual Studio code and the exact error: "Unable to find the" firebase "module)

+8
angular firebase angularfire
source share
1 answer

GIVE ANOTHER UPDATE: people should take a look at the new AngularFire project ( https://github.com/angular/angularfire2 and https://angularfire2.com/api/ ), which is currently in beta. This module takes care of the many problems that everyone faces.

Take a look at the jeffbcross typings.json file. This is where the compiler gets the "firebase" link.

UPDATE: In the case of this repo, the original author has a script specified in package.json named "install_typings" that can be called using:

 npm run install_typings 

This will install typings , which will help the "Typescript Definition Manager". You can also set typing in the usual way:

 npm install typings --global 

To install the Firebase definitions, I needed to run this command:

 typings install firebase --ambient --save 

The result should give you a new folder in the root of the project named "typings" with files and folders inside.

Hope this helps, given that it was hard for me to get any of Angular 2 with Firebase examples. The one with which I had the best success was r-park todo-angular2-firebase repo.

Good luck.

+5
source share

All Articles