Created
November 9, 2016 12:18
-
-
Save daslicht/f4ca6aa5ac4dd28bd2c01ddd6b4b0ba5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I have the following class which should represent one Collection in Firebase: | |
| ``` | |
| export class Slideshow { | |
| index: number; | |
| name: string; | |
| slides; | |
| } | |
| ``` | |
| When I click a list of Slideshows , one slideshow is set as selected slideshow. | |
| I am able to list its slides with something like this: | |
| ``` | |
| onSelect( slideshow ) { | |
| this.slides = this._af.database.list('/slideshows/'+slideshow.$key+'/slides',{}); | |
| ... | |
| ``` | |
| But when I set the type of slideshow to Slideshow like this | |
| ```onSelect( slideshow ) {```, | |
| I get: | |
| ```Property '$key' does not exist on type 'Slideshow’.any ``` | |
| I tried adding it to the Slides class , but that wont work since i never set it manually . | |
| How to deal with that autogenerated ```$key``` property ? | |
| please? |
Author
Author
export class Slideshow {
$key?:string;
index: number;
name: string;
slides;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following class which should represent one Collection in Firebase:
When I click a list of Slideshows , one slideshow is set as selected slideshow.
I am able to list its slides with something like this:
But when I set the type of slideshow to Slideshow like this
onSelect( slideshow ) {,I get:
Property '$key' does not exist on type 'Slideshow’.anyI tried adding it to the Slides class , but that wont work since i never set it manually .
How to deal with that autogenerated
$keyproperty ?please?