11import { StackLayout } from 'ui/layouts/stack-layout' ;
22import { Button } from 'ui/button' ;
33import { Label } from 'ui/label' ;
4- import { Inject , Component , View } from 'angular2/core' ;
4+ import { Inject , Component } from 'angular2/core' ;
55import { ApplicationRef } from 'angular2/src/core/application_ref' ;
66import * as profiling from './profiling' ;
77
8- @Component ( { selector : 'tree' , inputs : [ 'data' ] } )
9- @View ( {
10- directives : [ TreeComponent ] ,
11- template :
12- `<StackLayout>
8+ @Component ( {
9+ selector : 'tree' ,
10+ inputs : [ 'data' ] ,
11+ directives : [ TreeComponent ] ,
12+ template :
13+ `<StackLayout>
1314 <Label [text]="data.value"></Label>
1415 <StackLayout *ngIf="data.right != null">
1516 <tree [data]='data.right'></tree>
@@ -21,15 +22,13 @@ import * as profiling from './profiling';
2122 `
2223} )
2324class TreeComponent {
24- data : TreeNode ;
25+ data : TreeNode ;
2526}
2627
2728@Component ( {
28- selector : 'benchmark' ,
29- } )
30- @View ( {
29+ selector : 'benchmark' ,
3130 directives : [ TreeComponent ] ,
32- template : `
31+ template : `
3332 <StackLayout>
3433 <Label text='Benchmark!' fontSize='20' verticalAlignment='center' padding='20'></Label>
3534 <Button text="Baseline test" (tap)="baselineTest(baseline)"></Button>
@@ -88,29 +87,29 @@ export class Benchmark {
8887
8988 private createBaselineDom ( ) {
9089 var values = this . count ++ % 2 == 0 ? [ '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '*' ] :
91- [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , '-' ] ;
90+ [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , '-' ] ;
9291 this . initDataBaseline = buildTree ( this . maxDepth , values , 0 ) ;
9392 this . appRef . tick ( ) ;
9493 }
9594
9695 private createNgDom ( ) {
9796 var values = this . count ++ % 2 == 0 ? [ '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '*' ] :
98- [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , '-' ] ;
97+ [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , '-' ] ;
9998 this . initDataNg = buildTree ( this . maxDepth , values , 0 ) ;
10099 this . appRef . tick ( ) ;
101100 }
102101}
103102
104103
105104export class TreeNode {
106- value : string ;
107- left : TreeNode ;
108- right : TreeNode ;
109- constructor ( value , left , right ) {
110- this . value = value ;
111- this . left = left ;
112- this . right = right ;
113- }
105+ value : string ;
106+ left : TreeNode ;
107+ right : TreeNode ;
108+ constructor ( value , left , right ) {
109+ this . value = value ;
110+ this . left = left ;
111+ this . right = right ;
112+ }
114113}
115114
116115var nodes = 0 ;
0 commit comments