Expresion not Working in XML

nativescriptrocks
plugins

#1

Hello guys I have a newbiew question Im trying to created button like accordian,
when clicking on it is should toggle visibility of the content bellow
Here is my Code:

Button text=“click” tap=“openAccordian”>
StackLayout visibility="{{ toggle ? ‘visible’ : ‘collapse’ }}">
/StackLayout>

var toggle = true;
exports.openAccordian = function(){
console.log(“Opening accordian”);
var tr = pageData.get(‘toggle’);
pageData.set(‘toggle’,!tr);
}

But seems like the expression in StackLayout is not working at all ???
NOTE:
I want to do this in plain Javascript Im not using Angular