From 3d863ac63674eb8e8d07c5dded17859287d9bc36 Mon Sep 17 00:00:00 2001 From: Aleck Greenham Date: Sat, 22 Apr 2017 09:27:37 +0100 Subject: [PATCH] [js][database] Add ref property for consistency with web API --- lib/modules/database/reference.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/modules/database/reference.js b/lib/modules/database/reference.js index 0055ae59..b848cfda 100644 --- a/lib/modules/database/reference.js +++ b/lib/modules/database/reference.js @@ -350,6 +350,14 @@ export default class Reference extends ReferenceBase { return new Reference(this.database, this.path.substring(0, this.path.lastIndexOf('/'))); } + /** + * A reference to itself + * @type {!Reference} + * {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#ref} + */ + get ref(): Reference { + return this; + } /** * Returns a ref to the root of db - '/'