There is an official Angular 2 <-> Firebase library in developent by the team at Firebase / Google:
If you are just getting started with Angular 2 and Firebase, you should probably use that library. It certainly has more documentation and features than this one.
This third-party library still exists because:
An application should be able to consume data without caring about the on() Firebase API, Firebase events, or the object-as-pseudo-array convention.
The library currently includes:
Many areas are still under consideration and development:
By wrapping the Firebase API behind Observables, then consuming those Observables typically via an async pipe, it should never be necessary to manually subscribe and unsubscribe the Observables, nor manually hook and unhook Firebase events.
I believe that, if you find it necessary to write ngOnDestroy in a visual component, it is a sign that the component is not yet sufficienty abstracted.
It will generally "just work" with typescript and webpack. Other combinations might work, but still need attention.
As far as I can tell, TypeScript with NPM modules is still a topic of much discussion and work. This library does the following, it appears to be the preferred approach:
Older versions of this library included typings for Firebase; the "typings" and related tooling have made that obsolete. Use typings or other means to obtain the Firebase .d.ts file, and include it in your project.
For examples of working tsconfig and typings, see the demo:
Kyle Cordes http://kylecordes.com