Skip to content

Commit

Permalink
Merge pull request #138 from GoogleWebComponents/point-to-polymerfire
Browse files Browse the repository at this point in the history
added pointers to new polymerfire component
  • Loading branch information
ebidel committed Jun 4, 2016
2 parents 433081f + f4468dc commit 0e0815f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 19 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
firebase-element
## Note: This element is for the older Firebase 2.0 API.
For the latest official Firebase 3.0-compatible component from the Firebase team,
see the [polymerfire](https://github.com/firebase/polymerfire) component.

================

See the [component page](https://elements.polymer-project.org/elements/firebase-element?active=firebase-collection) for more information.
Expand Down
4 changes: 4 additions & 0 deletions firebase-auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<link rel="import" href="../polymer/polymer.html">

<!--
**Note: This element is for the older Firebase 2 API**
For the latest official Firebase 3.0-compatible component from the Firebase team,
see the [polymerfire](https://github.com/firebase/polymerfire) component.
Element wrapper for the Firebase authentication API (https://www.firebase.com/docs/web/guide/user-auth.html).
@demo demo/index.html
Expand Down
20 changes: 13 additions & 7 deletions firebase-collection.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<link rel="import" href="firebase-query-behavior.html">

<!--
**Note: This element is for the older Firebase 2 API**
For the latest official Firebase 3.0-compatible component from the Firebase team,
see the [polymerfire](https://github.com/firebase/polymerfire) component.
In this new component, the `firebase-collection` element has been replaced
with [`firebase-query`](https://github.com/firebase/polymerfire#firebase-query)
An element wrapper for the Firebase API that provides a view into the provided
Firebase location as an ordered collection.
Expand Down Expand Up @@ -257,7 +263,7 @@ <h4>[[dinosaur.__firebaseKey__]]</h4>

if (!this.query) {
this._fireQueryError('Query does not exist');
return;
return;
}

query = this.query.ref().push();
Expand Down Expand Up @@ -336,7 +342,7 @@ <h4>[[dinosaur.__firebaseKey__]]</h4>

if (!this.query) {
this._fireQueryError('Query does not exist');
return;
return;
}

var key = change.path.split('.')[1];
Expand Down Expand Up @@ -399,7 +405,7 @@ <h4>[[dinosaur.__firebaseKey__]]</h4>

try {
query = new Firebase(location);

if (orderByMethodName) {
if (orderByMethodName === 'orderByChild') {
query = query[orderByMethodName](this.orderByChild);
Expand Down Expand Up @@ -429,13 +435,13 @@ <h4>[[dinosaur.__firebaseKey__]]</h4>
}

} catch(e) {

this._fireQueryError('Query cannot be instantiated with location ' + location + ' (' + e.toString() + ')');

} finally {

return query;

}

},
Expand Down
24 changes: 14 additions & 10 deletions firebase-document.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<link rel="import" href="firebase-query-behavior.html">

<!--
**Note: This element is for the older Firebase 2 API**
For the latest official Firebase 3.0-compatible component from the Firebase team,
see the [polymerfire](https://github.com/firebase/polymerfire) component.
An element wrapper for the Firebase API.
A `<firebase-document>` is a reference to a remote document somewhere on
Expand Down Expand Up @@ -92,11 +96,11 @@
}
var query;
try {

query = new Firebase(location);

} catch(e) {

this._fireQueryError('Query cannot be instantiated with location ' + location + ' (' + e.toString() + ')');

} finally {
Expand All @@ -106,40 +110,40 @@

_updateRemoteDocument: function() {
this._log('Updating remote document');

if (!this.query) {

this._fireQueryError('Query does not exist');
return;
return;

}

this.query.update(this.dataAsObject);

},

_setRemoteDocumentChild: function(key, value) {
if (!this.query) {

this._fireQueryError('Query does not exist');
return;
return;

}

this.debounce('set-' + key, function() {
this._log('Setting child "' + key + '" to', value);
this.query.child(key).set(value);
});

},

_removeRemoteDocumentChild: function(key) {
this._log('Removing child "' + key + '"');

if (!this.query) {

this._fireQueryError('Query does not exist');
return;
return;

}

Expand Down
6 changes: 5 additions & 1 deletion firebase-query-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<link rel="import" href="firebase.html">

<script>
/** @polymerBehavior */
/** @polymerBehavior
**Note: This element is for the older Firebase 2 API**
For the latest official Firebase 3.0-compatible component from the Firebase team,
see the [polymerfire](https://github.com/firebase/polymerfire) component.
*/
Polymer.FirebaseQueryBehavior = {
properties: {
/**
Expand Down

0 comments on commit 0e0815f

Please sign in to comment.