Skip to content

Commit 83ec561

Browse files
committed
Angular 4.0 changes
1 parent 3063f99 commit 83ec561

File tree

6 files changed

+38
-32
lines changed

6 files changed

+38
-32
lines changed

app/dual-list.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ChangeDetectorRef, DoCheck, EventEmitter, Input, IterableDiffers, OnChanges,
1+
import { Component, DoCheck, EventEmitter, Input, IterableDiffers, OnChanges,
22
Output, SimpleChange } from '@angular/core';
33

44
type compareFunction = (a:any, b:any) => number;
@@ -126,7 +126,7 @@ export class DualListComponent implements DoCheck, OnChanges {
126126

127127
private sorter = (a:any, b:any) => { return (a._name < b._name) ? -1 : ((a._name > b._name) ? 1 : 0); };
128128

129-
constructor(private differs:IterableDiffers, private cdr:ChangeDetectorRef) {
129+
constructor(private differs:IterableDiffers) {
130130
}
131131

132132
ngOnChanges(changeRecord: {[key:string]:SimpleChange}) {
@@ -232,13 +232,13 @@ export class DualListComponent implements DoCheck, OnChanges {
232232
this.available.pick.length = 0;
233233

234234
if (this.source !== undefined) {
235-
this.sourceDiffer = this.differs.find(this.source).create(this.cdr);
235+
this.sourceDiffer = this.differs.find(this.source).create(null);
236236
}
237237
}
238238

239239
updatedDestination() {
240240
if (this.destination !== undefined) {
241-
this.destinationDiffer = this.differs.find(this.destination).create(this.cdr);
241+
this.destinationDiffer = this.differs.find(this.destination).create(null);
242242
}
243243
}
244244

demo/index.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Angular 2 Dual-Listbox Demo</title>
4+
<title>Angular 2+ Dual-Listbox Demo</title>
55
<meta charset="UTF-8">
66
<meta name="author" content="David Czeck">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -12,14 +12,13 @@
1212
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
1313
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
1414

15-
<script src="https://unpkg.com/typescript@2.0.10/lib/typescript.js"></script>
15+
<script src="https://unpkg.com/typescript@2.2.0/lib/typescript.js"></script>
1616

1717
<!-- Polyfill(s) for older browsers -->
1818
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>
1919

20-
<script src="https://unpkg.com/[email protected]?main=browser"></script>
21-
<script src="https://cdnjs.cloudflare.com/ajax/libs/reflect-metadata/0.1.8/Reflect.js"></script>
22-
<script src="https://unpkg.com/[email protected]/dist/system.src.js"></script>
20+
<script src="https://unpkg.com/[email protected]?main=browser"></script>
21+
<script src="https://unpkg.com/[email protected]/dist/system.src.js"></script>
2322

2423
<script src="demo/systemjs.config.js"></script>
2524
<script>
@@ -31,7 +30,7 @@
3130
<body>
3231
<demo-app><div style="margin:30px;">Loading...</div></demo-app>
3332

34-
<a href="https://github.com/czeckd/angular2-dual-listbox"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
33+
<a href="https://github.com/czeckd/angular-dual-listbox"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
3534
</body>
3635

3736

demo/systemjs.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
(function(global) {
22

3-
var ngVer = '@2.4.0';
3+
var ngVer = '@4.0.0';
44

55
// map tells the System loader where to look for things
66
var map = {
77
'app': 'app', // 'dist',
8-
'rxjs': 'https://unpkg.com/rxjs@5.0.1',
8+
'rxjs': 'https://unpkg.com/rxjs@5.2.0',
99
'@angular': 'https://unpkg.com/@angular'
1010
};
1111

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<title>Angular 2 Dual-Listbox Demo</title>
3+
<title>Angular 2+ Dual-Listbox Demo</title>
44
<meta charset="UTF-8">
55
<meta name="author" content="David Czeck">
66
<meta name="viewport" content="width=device-width, initial-scale=1">

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "angular2-dual-listbox",
3-
"description": "Angular 2 component for a dual listbox control.",
4-
"version": "2.4.0",
2+
"name": "angular-dual-listbox",
3+
"description": "Angular 2+ component for a dual listbox control.",
4+
"version": "4.0.0",
55
"repository": {
66
"type": "git",
7-
"url": "https://github.com/czeckd/angular2-dual-listbox.git"
7+
"url": "https://github.com/czeckd/angular-dual-listbox.git"
88
},
99
"author": "David Czeck",
1010
"license": "MIT",
@@ -16,23 +16,24 @@
1616
"lite": "lite-server"
1717
},
1818
"dependencies": {
19-
"@angular/common": "~2.4.0",
20-
"@angular/compiler": "~2.4.0",
21-
"@angular/core": "~2.4.0",
22-
"@angular/forms": "~2.4.0",
23-
"@angular/platform-browser": "~2.4.0",
24-
"@angular/platform-browser-dynamic": "~2.4.0",
19+
"@angular/common": "~4.0.0",
20+
"@angular/compiler": "~4.0.0",
21+
"@angular/core": "~4.0.0",
22+
"@angular/forms": "~4.0.0",
23+
"@angular/platform-browser": "~4.0.0",
24+
"@angular/platform-browser-dynamic": "~4.0.0",
2525
"core-js": "^2.4.1",
26-
"systemjs": "0.19.40",
27-
"reflect-metadata": "^0.1.8",
28-
"rxjs": "5.0.1",
29-
"zone.js": "^0.7.4"
26+
"systemjs": "0.19.47",
27+
"rxjs": "^5.2.0",
28+
"zone.js": "^0.8.4"
3029
},
3130
"devDependencies": {
32-
"@types/node": "^7.0.8",
31+
"@angular/compiler-cli": "^4.0.0",
32+
"@types/core-js": "^0.9.39",
33+
"@types/node": "^6.0.60",
3334
"concurrently": "^2.2.0",
3435
"lite-server": "^2.2.2",
35-
"tslint": "^3.15.1",
36-
"typescript": "^2.2.1"
36+
"tslint": "~4.5.0",
37+
"typescript": "~2.2.0"
3738
}
3839
}

tsconfig.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
9-
"lib": [ "es2015", "dom" ],
109
"removeComments": false,
1110
"noImplicitAny": true,
12-
"suppressImplicitAnyIndexErrors": true
11+
"suppressImplicitAnyIndexErrors": true,
12+
"typeRoots": [
13+
"node_modules/@types"
14+
],
15+
"lib": [
16+
"es2016",
17+
"dom"
18+
]
1319
}
1420
}

0 commit comments

Comments
 (0)