Search code examples
firebasefirebase-realtime-databaseangularfire

how to use variable in path firebase


let variable = "-KyCVrQ3WnarYdl6u9cp"
this.db.list('/data/{{variable}}').remove();

How do i use variables in path ?

i tried

{variable}
[variable]
${variable}

couldnt make it work.

thanks


Solution

  • you can try this

    this.db.list('/data/'+variable).remove();