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

feat(utils): Add $exists method to AFUnwrappedSnapshot #471

Merged
merged 3 commits into from
Aug 24, 2016
Merged

feat(utils): Add $exists method to AFUnwrappedSnapshot #471

merged 3 commits into from
Aug 24, 2016

Conversation

davideast
Copy link
Member

@davideast davideast commented Aug 24, 2016

Closes` #300. Also closes #464.

Exposes the DataSnapshot#exists function to the AFUnwrappedSnapshot.

af.database.object('myKey').subscribe((obj) => {
  if (obj.$exists()) {
    // object exists
  } else {
   // object does not exist
  }
});

@@ -37,6 +37,7 @@ export enum AuthMethods {
export interface AuthConfiguration {
method?: AuthMethods;
provider?: AuthProviders;
scope?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

fyi - this doesn't look like part of the $exists impl. This may not generate sufficient release notes from the commit message.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can make sure the changelog says the right thing.

@katowulf
Copy link
Contributor

One quick comment about the content of the commit, otherwise lgtm.

@davideast davideast merged commit f67aab1 into angular:master Aug 24, 2016
@davideast davideast deleted the snapshot-exists branch August 24, 2016 21:06
@davideast davideast added this to the beta.5 milestone Aug 24, 2016
@sean-hill
Copy link

Can this be available within the template also? Something like:

<pre>{{ (item | async)?.$exists }}</pre>

@alx-andru
Copy link
Contributor

@sean-hill I like the idea! +1

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.

firebaseAuthConfig Issue
5 participants