Skip to content

Commit cad4404

Browse files
committed
Update ng-sample for Angular beta 0
1 parent 7fb794d commit cad4404

File tree

4 files changed

+53
-55
lines changed

4 files changed

+53
-55
lines changed

ng-sample/app/benchmark.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import {StackLayout} from 'ui/layouts/stack-layout';
22
import {Button} from 'ui/button';
33
import {Label} from 'ui/label';
4-
import {Inject, Component, View, NgIf, NgFor} from 'angular2/angular2';
4+
import {Inject, Component, View} from 'angular2/core';
55
import {ApplicationRef} from 'angular2/src/core/application_ref';
66
import * as profiling from './profiling';
77

88
@Component({selector: 'tree', inputs: ['data']})
99
@View({
10-
directives: [TreeComponent, NgIf],
10+
directives: [TreeComponent],
1111
template:
1212
`<StackLayout>
1313
<Label [text]="data.value"></Label>
14-
<StackLayout *ng-if="data.right != null">
14+
<StackLayout *ngIf="data.right != null">
1515
<tree [data]='data.right'></tree>
1616
</StackLayout>
17-
<StackLayout *ng-if="data.left != null">
17+
<StackLayout *ngIf="data.left != null">
1818
<tree [data]='data.left'></tree>
1919
</StackLayout>
2020
</StackLayout>
@@ -28,7 +28,7 @@ class TreeComponent {
2828
selector: 'benchmark',
2929
})
3030
@View({
31-
directives: [NgIf, NgFor, TreeComponent],
31+
directives: [TreeComponent],
3232
template: `
3333
<StackLayout>
3434
<Label text='Benchmark!' fontSize='20' verticalAlignment='center' padding='20'></Label>

ng-sample/app/renderer-test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Inject, Component, View, NgIf, NgFor} from 'angular2/angular2';
1+
import {Inject, Component, View} from 'angular2/core';
22

33
@Component({
44
selector: 'templated-component',
@@ -8,10 +8,8 @@ export class TemplatedComponent {
88
}
99

1010
@Component({
11-
selector: 'renderer-test'
12-
})
13-
@View({
14-
directives: [NgIf, NgFor, TemplatedComponent],
11+
selector: 'renderer-test',
12+
directives: [TemplatedComponent],
1513
template: `
1614
<TabView>
1715
<TabView.items>
@@ -23,10 +21,10 @@ export class TemplatedComponent {
2321
<TextField #name text='John' fontSize='20' padding='20'></TextField>
2422
<Button [text]='buttonText' (tap)='onSave($event, name.text, $el)'></Button>
2523
<Button text='Toggle details' (tap)='onToggleDetails()'></Button>
26-
<TextView *ng-if='showDetails' [text]='detailsText'></TextView>
24+
<TextView *ngIf='showDetails' [text]='detailsText'></TextView>
2725
<Label text='==============================' fontSize='20'></Label>
28-
<StackLayout #more *ng-if='showDetails' orientation='vertical'>
29-
<TextField *ng-for='#detailLine of detailLines' [text]='detailLine'></TextField>
26+
<StackLayout #more *ngIf='showDetails' orientation='vertical'>
27+
<TextField *ngFor='#detailLine of detailLines' [text]='detailLine'></TextField>
3028
</StackLayout>
3129
<Label text='==============================' fontSize='20'></Label>
3230
</StackLayout>
@@ -56,7 +54,7 @@ export class RendererTest {
5654
this.moreDetailsText = 'More details:';
5755

5856
this.detailLines = [
59-
"ng-for inside a ng-if",
57+
"ngFor inside a ngIf",
6058
"Street address",
6159
"Country, city",
6260
];

ng-sample/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
},
2424
"homepage": "https://github.com/NativeScript/template-hello-world",
2525
"dependencies": {
26-
"@reactivex/rxjs": "5.0.0-alpha.7",
2726
"parse5": "1.4.2",
2827
"punycode": "1.3.2",
2928
"querystring": "0.2.0",
3029
"url": "0.10.3",
3130
"reflect-metadata": "0.1.2",
32-
"zone.js": "0.5.8"
31+
"rxjs": "5.0.0-beta.0",
32+
"zone.js": "0.5.10"
3333
},
3434
"devDependencies": {
3535
"grunt": "0.4.5",
@@ -39,13 +39,13 @@
3939
"grunt-ts": "5.0.0-beta.5",
4040
"nativescript-dev-typescript": "^0.2.2",
4141
"shelljs": "^0.5.3",
42-
"typescript": "^1.7.3",
42+
"typescript": "^1.7.5",
4343
"webpack": "^1.12.9"
4444
},
4545
"nativescript": {
4646
"id": "org.nativescript.ngsample",
4747
"tns-android": {
48-
"version": "1.5.0"
48+
"version": "1.5.1"
4949
}
5050
}
5151
}

ng-sample/tsconfig.json

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
{
2-
"compilerOptions": {
3-
"outDir": "app",
4-
"rootDir": "app",
5-
"module": "commonjs",
6-
"target": "es5",
7-
"inlineSourceMap": true,
8-
"experimentalDecorators": true,
9-
"removeComments": false,
10-
"emitDecoratorMetadata": true,
11-
"noEmitOnError": true
12-
},
13-
"files": [
14-
"app/app.ts",
15-
"app/benchmark.ts",
16-
"app/global.d.ts",
17-
"app/main-page.ts",
18-
"app/main-view-model.ts",
19-
"app/nativescript-angular/application.d.ts",
20-
"app/nativescript-angular/application.ts",
21-
"app/nativescript-angular/dom_adapter.ts",
22-
"app/nativescript-angular/element-registry.d.ts",
23-
"app/nativescript-angular/element-registry.ts",
24-
"app/nativescript-angular/polyfills/array.ts",
25-
"app/nativescript-angular/renderer.ts",
26-
"app/nativescript-angular/view_node.ts",
27-
"app/nativescript-angular/xhr.ts",
28-
"app/nativescript-angular/zone.ts",
29-
"app/nativescript-angular/zone_patch.ts",
30-
"app/profiling.ts",
31-
"app/renderer-test.ts",
32-
"app/starter.ts",
33-
"node_modules/tns-core-modules/tns-core-modules.d.ts"
34-
],
35-
"filesGlob": [
36-
"node_modules/tns-core-modules/tns-core-modules.d.ts",
37-
"app/**/*.ts"
38-
]
2+
"compilerOptions": {
3+
"outDir": "app",
4+
"rootDir": "app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"inlineSourceMap": true,
8+
"experimentalDecorators": true,
9+
"removeComments": false,
10+
"emitDecoratorMetadata": true,
11+
"noEmitOnError": true
12+
},
13+
"files": [
14+
"app/app.ts",
15+
"app/benchmark.ts",
16+
"app/global.d.ts",
17+
"app/main-page.ts",
18+
"app/main-view-model.ts",
19+
"app/nativescript-angular/application.d.ts",
20+
"app/nativescript-angular/application.ts",
21+
"app/nativescript-angular/dom_adapter.ts",
22+
"app/nativescript-angular/element-registry.d.ts",
23+
"app/nativescript-angular/element-registry.ts",
24+
"app/nativescript-angular/polyfills/array.ts",
25+
"app/nativescript-angular/renderer.ts",
26+
"app/nativescript-angular/view_node.ts",
27+
"app/nativescript-angular/xhr.ts",
28+
"app/nativescript-angular/zone.ts",
29+
"app/nativescript-angular/zone_patch.ts",
30+
"app/profiling.ts",
31+
"app/renderer-test.ts",
32+
"app/starter.ts",
33+
"node_modules/tns-core-modules/tns-core-modules.d.ts"
34+
],
35+
"filesGlob": [
36+
"node_modules/tns-core-modules/tns-core-modules.d.ts",
37+
"app/**/*.ts"
38+
]
3939
}

0 commit comments

Comments
 (0)