Skip to content
This repository was archived by the owner on Dec 19, 2021. It is now read-only.

Commit 43b6c63

Browse files
committed
update deps and demo
1 parent 051eea9 commit 43b6c63

32 files changed

+732
-647
lines changed

demo-angular/.editorconfig

Lines changed: 0 additions & 15 deletions
This file was deleted.

demo-angular/nativescript.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NativeScriptConfig } from '@nativescript/core';
2+
3+
export default {
4+
id: 'org.nativescript.demoangular',
5+
appResourcesPath: 'App_Resources',
6+
android: {
7+
v8Flags: '--expose_gc',
8+
markingMode: 'none',
9+
},
10+
appPath: 'src',
11+
} as NativeScriptConfig;

demo-angular/nsconfig.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

demo-angular/package.json

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
{
2-
"nativescript": {
3-
"id": "org.nativescript.demoangular",
4-
"tns-android": {
5-
"version": "6.5.0"
6-
},
7-
"tns-ios": {
8-
"version": "6.5.0"
9-
}
10-
},
11-
"description": "NativeScript Application",
12-
"license": "SEE LICENSE IN <your-license-filename>",
13-
"repository": "<fill-your-repository-here>",
14-
"dependencies": {
15-
"@angular/animations": "~8.2.0",
16-
"@angular/common": "~8.2.0",
17-
"@angular/compiler": "~8.2.0",
18-
"@angular/core": "~8.2.0",
19-
"@angular/forms": "~8.2.0",
20-
"@angular/platform-browser": "~8.2.0",
21-
"@angular/platform-browser-dynamic": "~8.2.0",
22-
"@angular/router": "~8.2.0",
23-
"@nativescript/theme": "~2.2.1",
24-
"@nstudio/nativescript-loading-indicator": "file:../src",
25-
"nativescript-angular": "~8.21.0",
26-
"reflect-metadata": "~0.1.12",
27-
"rxjs": "^6.4.0",
28-
"tns-core-modules": "~6.5.0",
29-
"zone.js": "~0.9.1"
30-
},
31-
"devDependencies": {
32-
"@angular/compiler-cli": "~8.2.0",
33-
"@ngtools/webpack": "~8.2.0",
34-
"nativescript-dev-webpack": "~1.5.1",
35-
"typescript": "~3.5.3"
36-
},
37-
"gitHead": "fa98f785df3fba482e5e2a0c76f4be1fa6dc7a14",
38-
"readme": "NativeScript Application"
2+
"description": "NativeScript Application",
3+
"license": "SEE LICENSE IN <your-license-filename>",
4+
"repository": "<fill-your-repository-here>",
5+
"dependencies": {
6+
"@angular/animations": "~8.2.0",
7+
"@angular/common": "~8.2.0",
8+
"@angular/compiler": "~8.2.0",
9+
"@angular/core": "~8.2.0",
10+
"@angular/forms": "~8.2.0",
11+
"@angular/platform-browser": "~8.2.0",
12+
"@angular/platform-browser-dynamic": "~8.2.0",
13+
"@angular/router": "~8.2.0",
14+
"@nativescript/theme": "~2.2.1",
15+
"@nstudio/nativescript-loading-indicator": "file:../src",
16+
"reflect-metadata": "~0.1.12",
17+
"rxjs": "^6.4.0",
18+
"zone.js": "~0.9.1",
19+
"@nativescript/core": "~7.0.0",
20+
"@nativescript/angular": "10.0.0"
21+
},
22+
"devDependencies": {
23+
"@angular/compiler-cli": "~8.2.0",
24+
"@ngtools/webpack": "~8.2.0",
25+
"typescript": "~3.9.7",
26+
"@nativescript/webpack": "~3.0.4"
27+
},
28+
"gitHead": "fa98f785df3fba482e5e2a0c76f4be1fa6dc7a14",
29+
"readme": "NativeScript Application",
30+
"main": "main.js"
3931
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { NgModule } from '@angular/core';
2-
import { NativeScriptRouterModule } from 'nativescript-angular/router';
32
import { Routes } from '@angular/router';
3+
import { NativeScriptRouterModule } from '@nativescript/angular';
44
import { LandingPageComponent } from './landing-page/landing-page.component';
55
import { PageTwoComponent } from './page-two/page-two.component';
66

77
const routes: Routes = [
8-
{ path: '', redirectTo: '/landing-page', pathMatch: 'full' },
9-
{ path: 'landing-page', component: LandingPageComponent },
10-
{ path: 'page-two-page', component: PageTwoComponent }
8+
{ path: '', redirectTo: '/landing-page', pathMatch: 'full' },
9+
{ path: 'landing-page', component: LandingPageComponent },
10+
{ path: 'page-two-page', component: PageTwoComponent },
1111
];
1212

1313
@NgModule({
14-
imports: [NativeScriptRouterModule.forRoot(routes)],
15-
exports: [NativeScriptRouterModule]
14+
imports: [NativeScriptRouterModule.forRoot(routes)],
15+
exports: [NativeScriptRouterModule],
1616
})
1717
export class AppRoutingModule {}

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2-
import { NativeScriptModule } from 'nativescript-angular/nativescript.module';
3-
2+
import { NativeScriptModule } from '@nativescript/angular';
43
import { AppRoutingModule } from './app-routing.module';
54
import { AppComponent } from './app.component';
65
import { LandingPageComponent } from './landing-page/landing-page.component';
7-
import { LoadingIndicatorService } from './services/loading-indicator.service';
86
import { PageTwoComponent } from './page-two/page-two.component';
7+
import { LoadingIndicatorService } from './services/loading-indicator.service';
98
import { TestNavService } from './services/test-nav.service';
109

1110
// Uncomment and add to NgModule imports if you need to use two-way binding
@@ -15,11 +14,11 @@ import { TestNavService } from './services/test-nav.service';
1514
// import { NativeScriptHttpClientModule } from "nativescript-angular/http-client";
1615

1716
@NgModule({
18-
bootstrap: [AppComponent],
19-
imports: [NativeScriptModule, AppRoutingModule],
20-
declarations: [AppComponent, LandingPageComponent, PageTwoComponent],
21-
providers: [LoadingIndicatorService, TestNavService],
22-
schemas: [NO_ERRORS_SCHEMA]
17+
bootstrap: [AppComponent],
18+
imports: [NativeScriptModule, AppRoutingModule],
19+
declarations: [AppComponent, LandingPageComponent, PageTwoComponent],
20+
providers: [LoadingIndicatorService, TestNavService],
21+
schemas: [NO_ERRORS_SCHEMA],
2322
})
2423
/*
2524
Pass your application module to the bootstrapModule function located in main.ts to start your app
Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
<StackLayout>
2-
<label style="text-align: center;" [text]="changeTestText"></label>
3-
<button text="Change test with new colour" (tap)="onPressChangeWithNewColourTest()"></button>
2+
<label style="text-align: center" [text]="changeTestText"></label>
3+
<button
4+
text="Change test with new colour"
5+
(tap)="onPressChangeWithNewColourTest()"
6+
></button>
47

5-
<label style="text-align: center;" [text]="duplicateTestText"></label>
6-
<button text="Duplicate show test with no text" (tap)="onPressDuplicateWithNoTextTest()"></button>
7-
<button text="Duplicate show test with same text" (tap)="onPressDuplicateWithSameTextTest()"></button>
8-
<button text="Duplicate show test with new message" (tap)="onPressDuplicateWithNewTextTest()"></button>
8+
<label style="text-align: center" [text]="duplicateTestText"></label>
9+
<button
10+
text="Duplicate show test with no text"
11+
(tap)="onPressDuplicateWithNoTextTest()"
12+
></button>
13+
<button
14+
text="Duplicate show test with same text"
15+
(tap)="onPressDuplicateWithSameTextTest()"
16+
></button>
17+
<button
18+
text="Duplicate show test with new message"
19+
(tap)="onPressDuplicateWithNewTextTest()"
20+
></button>
921

10-
<label style="text-align: center;" [text]="navigationTestText"></label>
11-
<button text="Navigate delayed test" (tap)="onPressNavigateDelayedTest()"></button>
12-
<button text="Navigate instant test" (tap)="onPressNavigateInstantTest()"></button>
22+
<label style="text-align: center" [text]="navigationTestText"></label>
23+
<button
24+
text="Navigate delayed test"
25+
(tap)="onPressNavigateDelayedTest()"
26+
></button>
27+
<button
28+
text="Navigate instant test"
29+
(tap)="onPressNavigateInstantTest()"
30+
></button>
1331
</StackLayout>
Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,64 @@
11
import { Component } from '@angular/core';
2-
import { setTimeout } from '@nativescript/core/timer/timer';
3-
2+
import { Utils } from '@nativescript/core';
43
import { LoadingIndicatorService } from '../services/loading-indicator.service';
54
import { TestNavService } from '../services/test-nav.service';
65

76
@Component({
8-
moduleId: module.id,
9-
selector: 'landing-page',
10-
templateUrl: 'landing-page.component.html'
7+
moduleId: module.id,
8+
selector: 'landing-page',
9+
templateUrl: 'landing-page.component.html',
1110
})
1211
export class LandingPageComponent {
13-
public changeTestText =
14-
'Perform multiple calls to the show method with different options.';
15-
public duplicateTestText = 'Perform multiple calls to the show method.';
16-
public navigationTestText =
17-
'Perform a service based navigation to a new page.';
12+
public changeTestText =
13+
'Perform multiple calls to the show method with different options.';
14+
public duplicateTestText = 'Perform multiple calls to the show method.';
15+
public navigationTestText =
16+
'Perform a service based navigation to a new page.';
1817

19-
constructor(
20-
private loadingIndicatorService: LoadingIndicatorService,
21-
private testNavService: TestNavService
22-
) {}
18+
constructor(
19+
private loadingIndicatorService: LoadingIndicatorService,
20+
private testNavService: TestNavService
21+
) {}
2322

24-
public async onPressChangeWithNewColourTest() {
25-
this.loadingIndicatorService.show();
26-
await new Promise(resolve => setTimeout(resolve, 1000));
27-
this.loadingIndicatorService.show(undefined, { color: '#d400bc' });
28-
await new Promise(resolve => setTimeout(resolve, 1000));
29-
this.loadingIndicatorService.hide();
30-
}
23+
public async onPressChangeWithNewColourTest() {
24+
this.loadingIndicatorService.show();
25+
await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
26+
this.loadingIndicatorService.show(undefined, { color: '#d400bc' });
27+
await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
28+
this.loadingIndicatorService.hide();
29+
}
3130

32-
public async onPressNavigateInstantTest() {
33-
this.loadingIndicatorService.show(
34-
'This should go away on the next page'
35-
);
36-
this.testNavService.tryNav();
37-
}
31+
public async onPressNavigateInstantTest() {
32+
this.loadingIndicatorService.show('This should go away on the next page');
33+
this.testNavService.tryNav();
34+
}
3835

39-
public async onPressNavigateDelayedTest() {
40-
this.loadingIndicatorService.show(
41-
'This should go away on the next page'
42-
);
43-
await new Promise(resolve => setTimeout(resolve, 1000));
44-
this.testNavService.tryNav();
45-
}
36+
public async onPressNavigateDelayedTest() {
37+
this.loadingIndicatorService.show('This should go away on the next page');
38+
await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
39+
this.testNavService.tryNav();
40+
}
4641

47-
public async onPressDuplicateWithNoTextTest() {
48-
this.duplicateShow();
49-
}
42+
public async onPressDuplicateWithNoTextTest() {
43+
this.duplicateShow();
44+
}
5045

51-
public async onPressDuplicateWithSameTextTest() {
52-
this.duplicateShow('Same text', 'Same text');
53-
}
46+
public async onPressDuplicateWithSameTextTest() {
47+
this.duplicateShow('Same text', 'Same text');
48+
}
5449

55-
public async onPressDuplicateWithNewTextTest() {
56-
this.duplicateShow(
57-
'This message should be replaced',
58-
'And only one spinner should show'
59-
);
60-
}
50+
public async onPressDuplicateWithNewTextTest() {
51+
this.duplicateShow(
52+
'This message should be replaced',
53+
'And only one spinner should show'
54+
);
55+
}
6156

62-
private async duplicateShow(messageOne?: string, messageTwo?: string) {
63-
this.loadingIndicatorService.show(messageOne);
64-
await new Promise(resolve => setTimeout(resolve, 1000));
65-
this.loadingIndicatorService.show(messageTwo);
66-
await new Promise(resolve => setTimeout(resolve, 1000));
67-
this.loadingIndicatorService.hide();
68-
}
57+
private async duplicateShow(messageOne?: string, messageTwo?: string) {
58+
this.loadingIndicatorService.show(messageOne);
59+
await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
60+
this.loadingIndicatorService.show(messageTwo);
61+
await new Promise((resolve) => Utils.setTimeout(resolve, 1000));
62+
this.loadingIndicatorService.hide();
63+
}
6964
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<StackLayout>
2-
<label text="You made it to page 2"></label>
2+
<label text="You made it to page 2"></label>
33
</StackLayout>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component } from '@angular/core';
22

33
@Component({
4-
moduleId: module.id,
5-
selector: 'page-two-page',
6-
templateUrl: 'page-two.component.html'
4+
moduleId: module.id,
5+
selector: 'page-two-page',
6+
templateUrl: 'page-two.component.html',
77
})
88
export class PageTwoComponent {}

0 commit comments

Comments
 (0)