Skip to content

Commit b1942d0

Browse files
committed
Debug ViewNode tree on button click
1 parent 9aaa306 commit b1942d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ng-sample/src/main-page.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ var lifeCycle: LifeCycle = null;
2222
<StackLayout orientation='vertical'>
2323
<Label text='Name' fontSize='32' verticalAlignment='center' padding='20'></Label>
2424
<TextField #name text='John' fontSize='32' padding='20'></TextField>
25-
<Button [text]='buttonText' (tap)='onSave($event, name.text)'></Button>
25+
<Button [text]='buttonText' (tap)='onSave($event, name.text, $el)'></Button>
2626
<Button text='Toggle details' (tap)='onToggleDetails()'></Button>
2727
<TextView *ng-if='showDetails' [text]='detailsText'></TextView>
2828
<StackLayout #more *ng-if='showDetails' orientation='vertical'>
2929
<TextField *ng-for='#detailLine of detailLines' [text]='detailLine'></TextField>
3030
</StackLayout>
31+
<Label text='..............' fontSize='32' verticalAlignment='center' padding='20'></Label>
3132
</StackLayout>
3233
`,
3334
})
@@ -40,7 +41,7 @@ class MainPage {
4041

4142
constructor() {
4243
this.buttonText = 'Save...'
43-
this.showDetails = false;
44+
this.showDetails = true;
4445
this.detailsText = 'plain ng-if directive \ndetail 1-2-3...';
4546
this.moreDetailsText = 'More details:';
4647

@@ -51,9 +52,10 @@ class MainPage {
5152
];
5253
}
5354

54-
onSave($event, name) {
55+
onSave($event, name, $el) {
5556
console.log('onSave event ' + $event + ' name ' + name);
56-
alert(name);
57+
//alert(name);
58+
$el.printTree();
5759
}
5860

5961
onToggleDetails() {

0 commit comments

Comments
 (0)