Skip to content

Commit 36a27c8

Browse files
committed
chore: update demos
1 parent 38af856 commit 36a27c8

25 files changed

+110
-100
lines changed

apps/demo-angular/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"main": "./src/main.ts",
33
"dependencies": {
4-
"@nativescript/core": "file:../../node_modules/@nativescript/core",
5-
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
64
"@nativescript/canvas": "file:../../dist/packages/canvas",
75
"@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon",
6+
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
87
"@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser",
98
"@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce",
109
"@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi",
1110
"@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill",
12-
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three"
11+
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three",
12+
"@nativescript/core": "file:../../node_modules/@nativescript/core",
13+
"three": "file:../../node_modules/three"
1314
},
1415
"devDependencies": {
15-
"@nativescript/android": "8.0.0",
16+
"@nativescript/android": "8.2.0-alpha.2",
1617
"@nativescript/ios": "8.0.0"
1718
}
18-
}
19+
}

apps/demo-angular/src/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import { NativeScriptModule } from '@nativescript/angular';
44
import { AppComponent } from './app.component';
55
import { AppRoutingModule } from './app-routing.module';
66
import { HomeComponent } from './home.component';
7+
import { CanvasModule } from '@nativescript/canvas/angular';
78

89
@NgModule({
910
schemas: [NO_ERRORS_SCHEMA],
1011
declarations: [AppComponent, HomeComponent],
1112
bootstrap: [AppComponent],
12-
imports: [NativeScriptModule, AppRoutingModule],
13+
imports: [NativeScriptModule, AppRoutingModule, CanvasModule],
1314
})
1415
export class AppModule {}

apps/demo-angular/src/home.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<ActionBar title="Demos"></ActionBar>
33
</ActionBar>
44
<GridLayout>
5-
<ListView [items]="demos">
5+
<ListView [items]="demos" (itemTap)="onTap($event)">
66
<ng-template let-item="item" let-i="index">
77
<GridLayout class="p-y-10">
8-
<Label [text]="item.name" [nsRouterLink]="['/' + item.name]"></Label>
8+
<Label [text]="item.name"></Label>
99
</GridLayout>
1010
</ng-template>
1111
</ListView>
Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
11
import { Component } from '@angular/core';
2-
2+
import { RouterExtensions } from '@nativescript/angular';
33
@Component({
44
selector: 'demo-home',
55
templateUrl: 'home.component.html',
66
})
77
export class HomeComponent {
8+
9+
constructor(private router: RouterExtensions){}
10+
811
demos = [
9-
{
10-
name: 'canvas'
11-
},
12-
{
13-
name: 'canvas-babylon'
14-
},
15-
{
16-
name: 'canvas-media'
17-
},
18-
{
19-
name: 'canvas-phaser'
20-
},
21-
{
22-
name: 'canvas-phaser-ce'
23-
},
24-
{
25-
name: 'canvas-pixi'
26-
},
27-
{
28-
name: 'canvas-polyfill'
29-
},
30-
{
31-
name: 'canvas-three'
12+
{
13+
name: 'canvas',
14+
},
15+
{
16+
name: 'canvas-babylon',
17+
},
18+
{
19+
name: 'canvas-media',
20+
},
21+
{
22+
name: 'canvas-phaser',
23+
},
24+
{
25+
name: 'canvas-phaser-ce',
26+
},
27+
{
28+
name: 'canvas-pixi',
29+
},
30+
{
31+
name: 'canvas-polyfill',
32+
},
33+
{
34+
name: 'canvas-three',
35+
},
36+
];
37+
38+
onTap(event){
39+
const item = this.demos[event.index];
40+
this.router.navigate(['/' + item.name]);
3241
}
33-
];
34-
}
42+
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<ActionBar title="canvas-babylon" class="action-bar"> </ActionBar>
22
<StackLayout class="p-20">
3-
<ScrollView class="h-full">
4-
<StackLayout>
5-
<Button text="Test canvas-babylon" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6-
</StackLayout>
7-
</ScrollView>
3+
84
</StackLayout>

apps/demo-angular/src/plugin-demos/canvas-babylon.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, NgZone } from '@angular/core';
22
import { DemoSharedCanvasBabylon } from '@demo/shared';
3-
import {} from '@nativescript/canvas-babylon';
43

54
@Component({
65
selector: 'demo-canvas-babylon',
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<ActionBar title="canvas-media" class="action-bar"> </ActionBar>
22
<StackLayout class="p-20">
3-
<ScrollView class="h-full">
4-
<StackLayout>
5-
<Button text="Test canvas-media" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6-
</StackLayout>
7-
</ScrollView>
3+
84
</StackLayout>

apps/demo-angular/src/plugin-demos/canvas-media.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, NgZone } from '@angular/core';
22
import { DemoSharedCanvasMedia } from '@demo/shared';
3-
import {} from '@nativescript/canvas-media';
43

54
@Component({
65
selector: 'demo-canvas-media',
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<ActionBar title="canvas-phaser-ce" class="action-bar"> </ActionBar>
22
<StackLayout class="p-20">
3-
<ScrollView class="h-full">
4-
<StackLayout>
5-
<Button text="Test canvas-phaser-ce" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
6-
</StackLayout>
7-
</ScrollView>
3+
84
</StackLayout>

apps/demo-angular/src/plugin-demos/canvas-phaser-ce.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, NgZone } from '@angular/core';
22
import { DemoSharedCanvasPhaserCe } from '@demo/shared';
3-
import {} from '@nativescript/canvas-phaser-ce';
43

54
@Component({
65
selector: 'demo-canvas-phaser-ce',

0 commit comments

Comments
 (0)