Hi, I am new to NativeScript, and facing a strange behavior I do not understand.
I’ve got a TextView bond on a Observable sub element link this :
<TextView text="{{ currentParagraf.text }}" propertyChange="textChanged"/>
The code behind…
pageData.set("currentParagraf", item); //item contains {id:1, text:"my text", currentlySelected:true ...}
On the first textChanged call, the currentParagraf is ok with it’s properties.
On the next textChanged call the currentParagraf contain only the textview text as a simple String, all the properties are gone.
I need to check a regex in the textChanged function, but only if other properties of the currentParagraf are presents…
function textChanged(args) {
if (pageData.get("currentParagraf").currentlySelected){
if(/found/.test(args.value)){
alert("text found");
}
}
}
Am I doing something wrong ?
Best regards
Julien