angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.7k stars 2.19k forks source link

Access Firebase ref #367

Closed jongood01 closed 8 years ago

jongood01 commented 8 years ago

Is it possible to access the Firebase object that has been created by Angularfire2? i.e. I want to be able to get the Firebase object with my Firebase details as set by defaultFirebase(). There are some things Angularfire2 doesn't do yet but I want to be able to do directly until support is there.

dotnwat commented 8 years ago

I will also add that I am trying to do this. I've gone through all of the github issues I could find that had to do with typings, but no matter what I continually get the error:

[nwatkins@eduroam-169-233-195-121 journaling]$ ng serve
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
  /home/nwatkins/journaling/tmp/broccoli_type_script_compiler-input_base_path-cwSQxM5U.tmp/0/src/app/app.component.ts (5, 27): Cannot find module 'firebase'.
    at BroccoliTypeScriptCompiler._doIncrementalBuild (/home/nwatkins/journaling/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:120:19)
    at BroccoliTypeScriptCompiler.build (/home/nwatkins/journaling/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:43:10)
    at /home/nwatkins/journaling/node_modules/angular-cli/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/home/nwatkins/journaling/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/home/nwatkins/journaling/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/home/nwatkins/journaling/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/home/nwatkins/journaling/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
LanderBeeuwsaert commented 8 years ago

I've solved it for now by:

To be able to retrieve the firebase reference through a :FirebaseObjectObservable angularFire object: In firebase_object_observable.d.ts, set private _ref; -> public _ref;

davideast commented 8 years ago

See #294. We're adding this in a future release.