Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database): Add $ref to observables #447

Merged
merged 3 commits into from
Sep 19, 2016

Conversation

katowulf
Copy link
Contributor

feat(FirebaseObjectObservable, FirebaseArrayObservable): Add $ref to observables

Makes the firebase.database.Reference used to create the observable public so that it can be used for accessing child records and paths relative to this collection/object.

This closes #294

…observables

Makes the firebase.database.Reference used to create the observable public so that it can be used for accessing child records and paths relative to this collection/object.

This closes angular#294
@katowulf
Copy link
Contributor Author

@davideast fyi

@davideast davideast changed the title Add $ref to observables fix(database): Add $ref to observables Aug 17, 2016
@davideast
Copy link
Member

@katowulf The build is failing but it's just a typings issue.

https://travis-ci.org/angular/angularfire2/builds/153088435#L329

src/database/firebase_list_observable.spec.ts(54,41): error TS2339: Property 'Reference' does not exist on type 'typeof database'.
src/database/firebase_object_observable.spec.ts(54,41): error TS2339: Property 'Reference' does not exist on type 'typeof database'.

I believe the type is firebase.database.DatabaseReference.

@katowulf
Copy link
Contributor Author

katowulf commented Aug 19, 2016

So a few things here. A) these all pass locally, and B) we're using import { database } from 'firebase'; So firebase.database.Reference and database.Reference should be equilavent here? I'll make the change but I'm pretty sure that linting check is wacked (and inconsistently different in Travis).

…created to address this.

Commented test units to correct `error TS2339`; bug angular#467 created to address this.
@katowulf
Copy link
Contributor Author

@davideast all tests should pass now (it's been 30 mins and Travis still hasn't started, you may need to kick it). Please review. We may need to squash something or some such? Got any instructs on that?

@@ -51,6 +49,16 @@ describe('FirebaseObservable', () => {
expect(O.map(noop) instanceof FirebaseListObservable).toBe(true);
});

describe('$ref', () => {
// it('should be a firebase.database.Reference', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't use xit because neither database.Reference nor firebase.database.Reference will compile in typescript until the bug is fixed : (

@katowulf
Copy link
Contributor Author

@davideast what's left here before we can get this merged?

@davideast
Copy link
Member

@katowulf Fix the merge conflicts and let's merge!

@katowulf
Copy link
Contributor Author

@davideast merge conflicts resolved!

@davideast
Copy link
Member

LGTM!

@davideast davideast merged commit a53fac0 into angular:master Sep 19, 2016
@katowulf katowulf deleted the kato-294-addref branch September 19, 2016 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: $ref on Observables (make _ref public)
3 participants