Visitar URL original
feat(utils): Add $exists method to AFUnwrappedSnapshot by davideast · Pull Request #471 · angular/angularfire · GitHub
Skip to content

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

Merged
davideast merged 3 commits into
angular:masterfrom
davideast:snapshot-exists
Aug 24, 2016
Merged

davideast merged 3 commits into
angular:masterfrom
davideast:snapshot-exists

Conversation

@davideast

@davideast davideast commented Aug 24, 2016 •

Copy link
Copy Markdown
Collaborator

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
  }
});

Comment thread src/auth/auth_backend.ts
export interface AuthConfiguration {
method?: AuthMethods;
provider?: AuthProviders;
scope?: string[];

Copy link
Copy Markdown
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
Copy Markdown
Collaborator 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
Copy Markdown
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
Copy Markdown

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

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

@alx-andru

Copy link
Copy Markdown
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