I'm new to this nativescript.I don't know how to get the stacklayout id properly.I'm working on Angular2 with typescript. I tried below code. I'm getting this below issue in command prompt.
JS:Error TypeError : Cannot set property 'visiblility' of undefined Context[object Object]
Html:
<StackLayout #target visibility="collapse" id ="stackLayout"> ..... </StackLayout>
On Clicking on the button, I need to show the visibility of stacklayout as visible programatically.
Typescript:
public stackLayout:StackLayout;
onTap(args: EventData) {
this.animate();
}
public animate() {
this.stackLayout.visibility = "visible" ;
}