Need to change label after getting the value from real time data base


#1

i need to create a dynamic label in my page which changes its text according to the value passed from the DB. Now i can log the value in the console but i need to present it in my XML page ie,from javascript to XML(a variable label that changes its text according to the value passed from connected firebase DB)
please help,


#2

If you are using Vanilla NativeScript, utilize Data Binding with Repeater.


#3

could you please give me an example for this
i need to pass the result.value from javascript to front end XML Label text.


#4

Here you go


#5

thanks you,
but my program’s structure is entirely different, i need to get the value by this.get(“role”) from XML and push the new value to that role which is defined like this

XML
Label text="{{role}}"

js
var role=this.get(“role”);
after getting the call back from firebase,i want to update the value returned in the JSON file to the front end XML file ie, to the Label text="{{role}}"
ie,
role=(JSON.stringify(result.value));
is there any other methods to do this,