Skip to content

Commit 2e9723d

Browse files
committed
Upgraded to NS+NG10
1 parent d7779ae commit 2e9723d

15 files changed

+15965
-13719
lines changed

package-lock.json

Lines changed: 15450 additions & 13287 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 69 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
11
{
2-
"name": "nativescript-pokedex",
3-
"nativescript": {
4-
"id": "org.nativescript.nativescriptpokedex",
5-
"tns-android": {
6-
"version": "6.5.1"
7-
},
8-
"tns-ios": {
9-
"version": "6.5.1"
10-
}
11-
},
12-
"version": "0.1.0",
13-
"scripts": {
14-
"ng": "ng",
15-
"start": "ng serve",
16-
"build": "ng build",
17-
"test": "ng test",
18-
"lint": "ng lint",
19-
"e2e": "ng e2e",
20-
"android": "tns run android",
21-
"ios": "tns run ios",
22-
"mobile": "tns run",
23-
"preview": "tns preview"
24-
},
25-
"private": true,
26-
"dependencies": {
27-
"@angular/animations": "~8.2.0",
28-
"@angular/common": "~8.2.0",
29-
"@angular/compiler": "~8.2.0",
30-
"@angular/core": "~8.2.0",
31-
"@angular/forms": "~8.2.0",
32-
"@angular/http": "~8.0.0-beta.10",
33-
"@angular/platform-browser": "~8.2.0",
34-
"@angular/platform-browser-dynamic": "~8.2.0",
35-
"@angular/router": "~8.2.0",
36-
"@nativescript/theme": "~2.2.1",
37-
"@ng-bootstrap/ng-bootstrap": "^5.3.1",
38-
"core-js": "^2.6.9",
39-
"nativescript-angular": "~8.20.0",
40-
"reflect-metadata": "~0.1.12",
41-
"rxjs": "~6.4.0",
42-
"tns-core-modules": "~6.3.0",
43-
"tslib": "1.10.0",
44-
"zone.js": "~0.9.1"
45-
},
46-
"devDependencies": {
47-
"@angular/cli": "~8.3.0",
48-
"@angular/compiler-cli": "~8.2.0",
49-
"@angular-devkit/build-angular": "~0.803.0",
50-
"@nativescript/schematics": "~1.0.0",
51-
"@nativescript/tslint-rules": "~0.0.5",
52-
"@types/jasmine": "~3.3.8",
53-
"@types/jasminewd2": "~2.0.3",
54-
"@types/node": "~8.9.4",
55-
"codelyzer": "^5.0.0",
56-
"jasmine-core": "~3.4.0",
57-
"jasmine-spec-reporter": "~4.2.1",
58-
"karma": "~4.1.0",
59-
"karma-chrome-launcher": "~2.2.0",
60-
"karma-coverage-istanbul-reporter": "~2.0.1",
61-
"karma-jasmine": "~2.0.1",
62-
"karma-jasmine-html-reporter": "^1.4.0",
63-
"nativescript-dev-webpack": "~1.4.0",
64-
"protractor": "~5.4.0",
65-
"ts-node": "~7.0.0",
66-
"tslint": "~5.15.0",
67-
"typescript": "~3.5.3"
68-
}
2+
"name": "nativescript-pokedex",
3+
"nativescript": {
4+
"id": "org.nativescript.nativescriptpokedex",
5+
"tns-android": {
6+
"version": "6.5.3"
7+
},
8+
"tns-ios": {
9+
"version": "6.5.2"
10+
}
11+
},
12+
"version": "0.1.0",
13+
"scripts": {
14+
"clean": "npx rimraf hooks node_modules package-lock.json platforms",
15+
"ng": "ng",
16+
"start": "ng serve",
17+
"build": "ng build",
18+
"test": "ng test",
19+
"lint": "ng lint",
20+
"e2e": "ng e2e",
21+
"android": "tns run android --no-hmr",
22+
"ios": "tns run ios --no-hmr",
23+
"mobile": "tns run",
24+
"preview": "tns preview",
25+
"ngcc": "ngcc --properties es2015 module main --first-only",
26+
"postinstall": "npm run ngcc"
27+
},
28+
"dependencies": {
29+
"@angular/animations": "~10.0.0",
30+
"@angular/common": "~10.0.0",
31+
"@angular/compiler": "~10.0.0",
32+
"@angular/core": "~10.0.0",
33+
"@angular/forms": "~10.0.0",
34+
"@angular/localize": "^10.0.7",
35+
"@angular/platform-browser": "~10.0.0",
36+
"@angular/platform-browser-dynamic": "~10.0.0",
37+
"@angular/router": "~10.0.0",
38+
"@nativescript/angular": "~10.0.0",
39+
"@nativescript/core": "rc",
40+
"@nativescript/theme": "~2.2.1",
41+
"@ng-bootstrap/ng-bootstrap": "7.0.0",
42+
"core-js": "^2.6.9",
43+
"reflect-metadata": "~0.1.12",
44+
"rxjs": "~6.5.5",
45+
"tslib": "1.10.0",
46+
"zone.js": "~0.10.2"
47+
},
48+
"devDependencies": {
49+
"@angular/cli": "~10.0.0",
50+
"@angular/compiler-cli": "~10.0.0",
51+
"@angular-devkit/build-angular": "~0.1000.2",
52+
"@nativescript/tslint-rules": "~0.0.5",
53+
"@types/jasmine": "~3.5.0",
54+
"@types/jasminewd2": "~2.0.3",
55+
"@types/node": "^12.11.1",
56+
"codelyzer": "^5.1.2",
57+
"jasmine-core": "~3.5.0",
58+
"jasmine-spec-reporter": "~4.2.1",
59+
"karma": "~4.4.1",
60+
"karma-chrome-launcher": "~3.1.0",
61+
"karma-coverage-istanbul-reporter": "~2.1.0",
62+
"karma-jasmine": "~3.0.1",
63+
"karma-jasmine-html-reporter": "^1.4.2",
64+
"@nativescript/webpack": "~2.0.0",
65+
"protractor": "~5.4.3",
66+
"ts-node": "~8.3.0",
67+
"tslint": "~6.1.0",
68+
"typescript": "~3.9.0",
69+
"node-sass": "^4.7.1"
70+
}
6971
}

src/app/app-routing.module.tns.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NgModule } from '@angular/core';
2-
import { NativeScriptRouterModule } from 'nativescript-angular/router';
2+
import { NativeScriptRouterModule } from '@nativescript/angular';
3+
34
import { routes } from '@src/app/app.routes';
45

56
@NgModule({

src/app/app-routing.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule } from '@angular/router';
3+
34
import { routes } from '@src/app/app.routes';
45

56
@NgModule({

src/app/app.component.tns.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
iOS has issues with nested pages with Page
33
Ref: https://github.com/NativeScript/nativescript-angular/issues/1441
44
-->
5-
<page-router-outlet></page-router-outlet>
5+
<GridLayout>
6+
<page-router-outlet></page-router-outlet>
7+
</GridLayout>

src/app/app.module.tns.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
2-
import { NativeScriptModule } from 'nativescript-angular/nativescript.module';
3-
import { NativeScriptCommonModule } from 'nativescript-angular/common';
4-
import { NativeScriptHttpClientModule } from 'nativescript-angular/http-client';
5-
import { NativeScriptFormsModule } from 'nativescript-angular/forms';
2+
import { NativeScriptModule, NativeScriptCommonModule, NativeScriptHttpClientModule, NativeScriptFormsModule } from '@nativescript/angular';
63

74
import { AppRoutingModule } from '@src/app/app-routing.module';
85
import { AppComponent } from '@src/app/app.component';

src/app/pages/home/home.page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ export class HomePage implements OnInit {
2626
this.gridLayoutRows = 'auto auto * auto';
2727
this.gridElementsRows = ['0', '1', '2', '3'];
2828
}
29-
this.cdr.detectChanges();
3029
}
3130
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { Injectable } from '@angular/core';
22

3-
import * as applicationSettings from 'tns-core-modules/application-settings';
3+
import { ApplicationSettings } from '@nativescript/core';
44

55
@Injectable()
66
export class CacheService {
77

88
constructor() { }
99

1010
get(key: string): string {
11-
return applicationSettings.getString(key);
11+
return ApplicationSettings.getString(key);
1212
}
1313
put(key: string, val: string): void {
14-
applicationSettings.setString(key, val);
14+
ApplicationSettings.setString(key, val);
1515
}
1616

1717
remove(key: string): void {
18-
applicationSettings.remove(key);
18+
ApplicationSettings.remove(key);
1919
}
2020
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { Injectable, Inject } from '@angular/core';
2-
import { DEVICE } from 'nativescript-angular/platform-providers';
3-
import { Device, platformNames, screen } from 'tns-core-modules/platform';
1+
import { Injectable } from '@angular/core';
2+
import { isAndroid, isIOS, Screen } from '@nativescript/core';
43

54
import { debugLog, camelCaseToSpaced, kebabCaseToSpaced, generatePokemonObject } from '@src/app/utils/app-utils/app-utils.common';
65

76

87
@Injectable()
98
export class AppUtils {
109

11-
constructor(@Inject(DEVICE) private device: Device) { }
10+
constructor() { }
1211

1312
debugLog = debugLog;
1413
camelCaseToSpaced = camelCaseToSpaced;
@@ -22,16 +21,16 @@ export class AppUtils {
2221

2322
platform = (verbose: boolean = false): 'web' | 'mobile' | 'android' | 'ios' => {
2423
if (verbose) {
25-
if (this.device.os === platformNames.android) {
24+
if (isAndroid) {
2625
return 'android';
27-
} else if (this.device.os === platformNames.ios) {
26+
} else if (isIOS) {
2827
return 'ios';
2928
}
3029
}
3130
return 'mobile';
3231
}
3332

3433
screenWidth = (): number => {
35-
return screen.mainScreen.widthDIPs;
34+
return Screen.mainScreen.widthDIPs;
3635
}
3736
}

src/app/utils/hide-action-bar/hide-action-bar.tns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Directive } from '@angular/core';
2-
import { Page } from 'tns-core-modules/ui/page/page';
2+
import { Page } from '@nativescript/core';
33

44
@Directive({
55
selector: '[hideActionBar]'

0 commit comments

Comments
 (0)