0
//this is short hand not actual code please

var =  trainNum = 0;

// on button click

trainNum++;

// I can't figure out the format to put in so that firebase treats trainNum as the variable and not a string.
 database.ref(Trains/**I WANT THIS TO EQUAL THE trainNum as it increments **).push({
});

//Train number is being stored in database I don't know if this will effect outcome. 
4

1 回答 1

0

您必须从数据库中获取 trainNum,而不是将其设置为 0。

我不确定这是否是您的问题?

于 2017-11-22T19:40:21.910 回答