Skip to content

Commit 036aa1e

Browse files
committed
updates for NS 3.4 & angular 5.1
1 parent ae88de6 commit 036aa1e

16 files changed

+290
-460
lines changed

angular/grid-view-comp.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
AfterContentInit,
2222
AfterViewInit,
2323
ChangeDetectionStrategy,
24-
ChangeDetectorRef,
2524
Component,
2625
ContentChild,
2726
DoCheck,
@@ -120,7 +119,7 @@ export class GridViewComponent implements DoCheck, OnDestroy, AfterContentInit,
120119
}
121120
if (needDiffer && !this._differ && isListLikeIterable(value)) {
122121
this._differ = this._iterableDiffers.find(this._items)
123-
.create(this._cdr, (_index, item) => item);
122+
.create((_index, item) => item);
124123
}
125124

126125
this.gridView.items = this._items;
@@ -132,8 +131,7 @@ export class GridViewComponent implements DoCheck, OnDestroy, AfterContentInit,
132131
private itemTemplate: TemplateRef<GridItemContext>;
133132

134133
constructor(@Inject(ElementRef) _elementRef: ElementRef,
135-
@Inject(IterableDiffers) private _iterableDiffers: IterableDiffers,
136-
@Inject(ChangeDetectorRef) private _cdr: ChangeDetectorRef) {
134+
@Inject(IterableDiffers) private _iterableDiffers: IterableDiffers) {
137135
this.gridView = _elementRef.nativeElement;
138136

139137
this.gridView.on(GridView.itemLoadingEvent, this.onItemLoading, this);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const AppModuleNgFactory: any;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
require("application");
22
if (!global["__snapshot"]) {
3-
/*
4-
In case snapshot generation is enabled these modules will get into the bundle but will not be required/evaluated.
5-
The snapshot webpack plugin will add them to the tns-java-classes.js bundle file. This way, they will be evaluated on app start as early as possible.
6-
*/
3+
// In case snapshot generation is enabled these modules will get into the bundle
4+
// but will not be required/evaluated.
5+
// The snapshot webpack plugin will add them to the tns-java-classes.js bundle file.
6+
// This way, they will be evaluated on app start as early as possible.
77
require("ui/frame");
88
require("ui/frame/activity");
99
}

demo-ng/app/vendor-platform.ios.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// There is a bug in angular: https://github.com/angular/angular-cli/pull/8589/files
2+
// Legendary stuff, its webpack plugin pretty much doesn't work with empty TypeScript files in v1.8.3
3+
void 0;

demo-ng/app/vendor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Snapshot the ~/app.css and the theme
2+
const application = require("application");
3+
require("ui/styling/style-scope");
4+
const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/);
5+
global.registerWebpackModules(appCssContext);
6+
application.loadAppCss();
7+
18
require("./vendor-platform");
29

310
require("reflect-metadata");

demo-ng/package.json

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"nativescript": {
33
"id": "com.tangrainc.nggridviewsample",
44
"tns-android": {
5-
"version": "3.2.0"
5+
"version": "3.4.1"
66
},
77
"tns-ios": {
8-
"version": "3.2.0"
8+
"version": "3.4.1"
99
}
1010
},
1111
"scripts": {
@@ -18,42 +18,45 @@
1818
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
1919
},
2020
"dependencies": {
21-
"@angular/animations": "~4.2.5",
22-
"@angular/common": "~4.2.5",
23-
"@angular/compiler": "~4.2.5",
24-
"@angular/core": "~4.2.5",
25-
"@angular/forms": "~4.2.5",
26-
"@angular/http": "~4.2.5",
27-
"@angular/platform-browser": "~4.2.5",
28-
"@angular/platform-browser-dynamic": "~4.2.5",
29-
"@angular/router": "~4.2.5",
30-
"nativescript-angular": "4.2.0",
21+
"@angular/animations": "~5.1.0",
22+
"@angular/common": "~5.1.0",
23+
"@angular/compiler": "~5.1.0",
24+
"@angular/core": "~5.1.0",
25+
"@angular/forms": "~5.1.0",
26+
"@angular/http": "~5.1.0",
27+
"@angular/platform-browser": "~5.1.0",
28+
"@angular/platform-browser-dynamic": "~5.1.0",
29+
"@angular/router": "~5.1.0",
30+
"nativescript-angular": "5.1.0",
3131
"nativescript-grid-view": "file:../bin/dist",
3232
"nativescript-theme-core": "^1.0.4",
3333
"reflect-metadata": "~0.1.8",
34-
"rxjs": "~5.2.0",
35-
"tns-core-modules": "3.2.0",
36-
"zone.js": "~0.8.2"
34+
"rxjs": "^5.5.0",
35+
"tns-core-modules": "^3.4.0",
36+
"zone.js": "^0.8.4"
3737
},
3838
"devDependencies": {
39-
"@angular/compiler-cli": "~4.2.5",
40-
"@ngtools/webpack": "~1.6.0",
39+
"@angular/compiler-cli": "~5.1.0",
40+
"@ngtools/webpack": "~1.9.1",
4141
"babel-traverse": "6.24.1",
4242
"babel-types": "6.24.1",
4343
"babylon": "6.17.0",
44-
"copy-webpack-plugin": "~4.0.1",
45-
"extract-text-webpack-plugin": "~3.0.0",
44+
"copy-webpack-plugin": "~4.3.0",
45+
"extract-text-webpack-plugin": "~3.0.2",
4646
"lazy": "1.0.11",
4747
"nativescript-css-loader": "~0.26.0",
4848
"nativescript-dev-sass": "^1.3.2",
4949
"nativescript-dev-typescript": "0.4.2",
50-
"nativescript-dev-webpack": "^0.8.0",
50+
"nativescript-dev-webpack": "^0.9.0",
5151
"nativescript-worker-loader": "~0.8.1",
5252
"raw-loader": "~0.5.1",
53-
"resolve-url-loader": "~2.1.0",
54-
"typescript": "~2.2.0",
55-
"webpack": "~3.2.0",
56-
"webpack-bundle-analyzer": "^2.8.2",
57-
"webpack-sources": "~1.0.1"
53+
"resolve-url-loader": "~2.2.1",
54+
"typescript": "~2.4.2",
55+
"webpack": "~3.10.0",
56+
"webpack-bundle-analyzer": "^2.9.1",
57+
"webpack-sources": "~1.1.0",
58+
"css-loader": "~0.28.7",
59+
"uglifyjs-webpack-plugin": "~1.1.6",
60+
"sass-loader": "~6.0.6"
5861
}
5962
}

demo-ng/tsconfig.aot.json

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

demo-ng/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
},
2222
"exclude": [
2323
"node_modules",
24-
"platforms",
25-
"**/*.aot.ts"
24+
"platforms"
2625
]
2726
}

0 commit comments

Comments
 (0)