Skip to content

Commit 066dbb6

Browse files
committed
WIP: ng 4.2 support
1 parent bd38745 commit 066dbb6

File tree

7 files changed

+230
-294
lines changed

7 files changed

+230
-294
lines changed

Diff for: nativescript-angular/animations.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
import { NgModule, Injectable, NgZone, Provider, RendererFactory2 } from "@angular/core";
22

3+
import { AnimationBuilder } from "@angular/animations";
4+
35
import {
46
AnimationDriver,
57
ɵAnimationEngine as AnimationEngine,
68
ɵAnimationStyleNormalizer as AnimationStyleNormalizer,
7-
ɵWebAnimationsStyleNormalizer as WebAnimationsStyleNormalizer
9+
ɵWebAnimationsStyleNormalizer as WebAnimationsStyleNormalizer,
810
} from "@angular/animations/browser";
911

10-
import { ɵAnimationRendererFactory as AnimationRendererFactory } from "@angular/platform-browser/animations";
12+
import {
13+
ɵAnimationRendererFactory as AnimationRendererFactory,
14+
ɵBrowserAnimationBuilder as BrowserAnimationBuilder,
15+
} from "@angular/platform-browser/animations";
1116

12-
import { NativeScriptAnimationEngine } from "./animations/animation-engine";
1317
import { NativeScriptAnimationDriver } from "./animations/animation-driver";
1418
import { NativeScriptModule } from "./nativescript.module";
1519
import { NativeScriptRendererFactory } from "./renderer";
1620

1721
@Injectable()
18-
export class InjectableAnimationEngine extends NativeScriptAnimationEngine {
22+
export class InjectableAnimationEngine extends AnimationEngine {
1923
constructor(driver: AnimationDriver, normalizer: AnimationStyleNormalizer) {
2024
super(driver, normalizer);
2125
}
@@ -35,6 +39,7 @@ export function instanciateDefaultStyleNormalizer() {
3539
}
3640

3741
export const NATIVESCRIPT_ANIMATIONS_PROVIDERS: Provider[] = [
42+
{provide: AnimationBuilder, useClass: BrowserAnimationBuilder},
3843
{provide: AnimationDriver, useFactory: instantiateSupportedAnimationDriver},
3944
{provide: AnimationStyleNormalizer, useFactory: instanciateDefaultStyleNormalizer},
4045
{provide: AnimationEngine, useClass: InjectableAnimationEngine}, {

Diff for: nativescript-angular/animations/animation-engine.ts

-144
This file was deleted.

Diff for: nativescript-angular/animations/animation-player.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
1717
constructor(
1818
private target: NgView,
1919
keyframes: Keyframe[],
20-
duration: number,
21-
delay: number,
20+
private duration: number,
21+
private delay: number,
2222
easing: string
2323
) {
2424
this.initKeyframeAnimation(keyframes, duration, delay, easing);
2525
}
2626

27+
get totalTime(): number { return this.delay + this.duration; }
28+
2729
init(): void {
2830
}
2931

Diff for: nativescript-angular/package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,27 @@
4343
"reflect-metadata": "^0.1.8"
4444
},
4545
"peerDependencies": {
46-
"@angular/common": "~4.0.0 || ~4.1.0",
47-
"@angular/compiler": "~4.0.0 || ~4.1.0",
48-
"@angular/core": "~4.0.0 || ~4.1.0",
49-
"@angular/forms": "~4.0.0 || ~4.1.0",
50-
"@angular/http": "~4.0.0 || ~4.1.0",
51-
"@angular/platform-browser": "~4.0.0 || ~4.1.0",
52-
"@angular/router": "~4.0.0 || ~4.1.0",
46+
"@angular/common": "~4.2.4",
47+
"@angular/compiler": "~4.2.4",
48+
"@angular/core": "~4.2.4",
49+
"@angular/forms": "~4.2.4",
50+
"@angular/http": "~4.2.4",
51+
"@angular/platform-browser": "~4.2.4",
52+
"@angular/router": "~4.2.4",
5353
"rxjs": "^5.0.1",
5454
"tns-core-modules": "^3.0.0",
5555
"zone.js": "^0.8.4"
5656
},
5757
"devDependencies": {
58-
"@angular/animations": "~4.0.0 || ~4.1.0",
59-
"@angular/common": "~4.0.0 || ~4.1.0",
60-
"@angular/compiler": "~4.0.0 || ~4.1.0",
61-
"@angular/compiler-cli": "~4.0.0 || ~4.1.0",
62-
"@angular/core": "~4.0.0 || ~4.1.0",
63-
"@angular/forms": "~4.0.0 || ~4.1.0",
64-
"@angular/http": "~4.0.0 || ~4.1.0",
65-
"@angular/platform-browser": "~4.0.0 || ~4.1.0",
66-
"@angular/router": "~4.0.0 || ~4.1.0",
58+
"@angular/animations": "~4.2.4",
59+
"@angular/common": "~4.2.4",
60+
"@angular/compiler": "~4.2.4",
61+
"@angular/compiler-cli": "~4.2.4",
62+
"@angular/core": "~4.2.4",
63+
"@angular/forms": "~4.2.4",
64+
"@angular/http": "~4.2.4",
65+
"@angular/platform-browser": "~4.2.4",
66+
"@angular/router": "~4.2.4",
6767
"codelyzer": "^3.0.1",
6868
"rxjs": "^5.0.1",
6969
"tns-core-modules": "next",

0 commit comments

Comments
 (0)