Wondering how to use inline buttons to increment or decrease a property in a database? See the solution—and a fun example—below!
To create similar functionality, add three properties to your database:
Number
where you store your countButton
for AddingButton
for SubtractingFor 2 and 3, setup your buttons as shown to the right.
current.prop("Number")+1
current.prop("Number")+1
For subtraction, change the +
to a -