Skip to content

Commit 20120f2

Browse files
authored
Merge pull request NativeScript#405 from NativeScript/hdeshev/ng-rc5
Support Angular RC5
2 parents 1abebfe + f4d9d32 commit 20120f2

File tree

121 files changed

+1359
-1458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1359
-1458
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
env:
22
global:
3-
- NODE_VERSION=4.4.7
3+
- NODE_VERSION=6.4.0
44
- DATE=$(date +%Y-%m-%d)
55
- PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
66

@@ -22,7 +22,7 @@ before_cache:
2222

2323
cache:
2424
directories:
25-
- .nvm
25+
- $HOME/.nvm
2626
- $HOME/.gradle/caches/
2727
- $HOME/.gradle/wrapper/
2828

@@ -36,18 +36,19 @@ install:
3636
- npm install
3737
- npm link
3838
- cd ../tests
39+
- tns install
3940
- npm link nativescript-angular
40-
- npm install
4141

4242
before_script:
4343
- echo no | android create avd --force -n test -t android-19 -b armeabi-v7a
44-
- emulator -avd test -no-audio -no-window &
45-
- android-wait-for-emulator
44+
- emulator -memory 1024 -avd test -no-audio -no-window &
4645

4746
script:
48-
- tns platform add android
49-
- tns test android --emulator --justlaunch
50-
- npm run appium-android
47+
- # DISABLE KARMA TESTS - hanging the build on Travis
48+
- # tns test android --emulator --justlaunch
49+
- tns build android
50+
- android-wait-for-emulator
51+
- npm run run-appium-android
5152

5253
before_deploy:
5354
- cd ../nativescript-angular

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.4.0 (2016-08-19)
2+
3+
- Migrate to Angular 2 RC5.
4+
- Bootstrapping apps using NgModule's. The old `nativescriptBootstrap` method is gone, and apps should switch to the `platformNativeScriptDynamic().bootstrapModule(MyAppModule)` API
5+
- The library entrypoint is now the `nativescript-angular/platform` module. Import `NativeScriptRouterModule` from `nativescript-angular/router` and `NativeScriptFormsModule` from `nativescript-angular/forms` respectively if you want to use routing and form value accessor directives.
6+
17
# 0.1.8 (2016-06-22)
28

39
- Migrate to Migrate to Angular RC3 and Angular Router 3.0.0-alpha.7:
@@ -34,4 +40,4 @@
3440
- `nativescript-angular/router` -> `nativescript-angular/router-deprecated`
3541
- `nativescript-angular/router/ns-router` -> `nativescript-angular/router-deprecated/ns-router-deprecated`
3642

37-
- Build requires globally installed **typings** (`npm install -g typings`)
43+
- Build requires globally installed **typings** (`npm install -g typings`)

nativescript-angular/animation-driver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { AnimationKeyframe } from '@angular/core/src/animation/animation_keyframe';
22
import { AnimationPlayer } from '@angular/core/src/animation/animation_player';
33
import { AnimationStyles } from '@angular/core/src/animation/animation_styles';
4-
import { AnimationDriver } from '@angular/core/src/animation/animation_driver';
4+
import { AnimationDriver } from '@angular/platform-browser/src/dom/animation_driver';
55
import { NativeScriptAnimationPlayer } from './animation-player';
66
import {View} from "ui/core/view";
77
import styleProperty = require('ui/styling/style-property');

nativescript-angular/animation-player.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
1313

1414
private _subscriptions: Function[] = [];
1515
private _finished = false;
16+
private _started = false;
1617
private animation: KeyframeAnimation;
1718
private target: View;
1819

@@ -63,18 +64,28 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
6364
this.animation = KeyframeAnimation.keyframeAnimationFromInfo(keyframeAnimationInfo, observable.ValueSource.VisualState);
6465
}
6566

67+
init(): void {
68+
}
69+
70+
hasStarted(): boolean {
71+
return this._started;
72+
}
73+
74+
6675
onDone(fn: Function): void { this._subscriptions.push(fn); }
6776

6877
private _onFinish() {
6978
if (!this._finished) {
7079
this._finished = true;
80+
this._started = false;
7181
this._subscriptions.forEach(fn => fn());
7282
this._subscriptions = [];
7383
}
7484
}
7585

7686
play(): void {
7787
if (this.animation) {
88+
this._started = true;
7889
this.animation.play(this.target)
7990
.then(() => { this._onFinish(); })
8091
.catch((e) => { });

nativescript-angular/application.ts

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

nativescript-angular/directives.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
import {Type} from '@angular/core/src/facade/lang';
22
import {ListViewComponent, SetupItemViewArgs} from './directives/list-view-comp';
3-
import {TextValueAccessor} from './value-accessors/text-value-accessor';
4-
import {CheckedValueAccessor} from './value-accessors/checked-value-accessor';
5-
import {DateValueAccessor} from './value-accessors/date-value-accessor';
6-
import {TimeValueAccessor} from './value-accessors/time-value-accessor';
7-
import {NumberValueAccessor} from './value-accessors/number-value-accessor';
8-
import {SelectedIndexValueAccessor} from './value-accessors/selectedIndex-value-accessor';
93
import {TabViewDirective, TabViewItemDirective} from './directives/tab-view';
104
import {ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective} from './directives/action-bar';
115
import {AndroidFilterComponent, IosFilterComponent} from './directives/platform-filters';
126

7+
138
export const NS_DIRECTIVES: Type[] = [
149
ListViewComponent,
1510
TabViewDirective,
1611
TabViewItemDirective,
17-
TextValueAccessor,
18-
CheckedValueAccessor,
19-
DateValueAccessor,
20-
TimeValueAccessor,
21-
SelectedIndexValueAccessor,
22-
NumberValueAccessor,
2312
ActionBarComponent,
2413
ActionBarScope,
2514
ActionItemDirective,

nativescript-angular/dom-adapter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export class NativeScriptElementSchemaRegistry extends ElementSchemaRegistry {
2323
return propName;
2424
}
2525

26+
getDefaultComponentElementName(): string {
27+
return 'ng-component';
28+
}
29+
2630
securityContext(tagName: string, propName: string): any {
2731
return SecurityContext.NONE;
2832
}

nativescript-angular/forms.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Type } from '@angular/core/src/facade/lang';
2+
import { NgModule } from "@angular/core";
3+
import { FormsModule } from "@angular/forms";
4+
import { TextValueAccessor } from './value-accessors/text-value-accessor';
5+
import { CheckedValueAccessor } from './value-accessors/checked-value-accessor';
6+
import { DateValueAccessor } from './value-accessors/date-value-accessor';
7+
import { TimeValueAccessor } from './value-accessors/time-value-accessor';
8+
import { NumberValueAccessor } from './value-accessors/number-value-accessor';
9+
import { SelectedIndexValueAccessor } from './value-accessors/selectedIndex-value-accessor';
10+
11+
export const FORMS_DIRECTIVES: Type[] = [
12+
TextValueAccessor,
13+
CheckedValueAccessor,
14+
DateValueAccessor,
15+
TimeValueAccessor,
16+
SelectedIndexValueAccessor,
17+
NumberValueAccessor,
18+
];
19+
20+
@NgModule({
21+
declarations: FORMS_DIRECTIVES,
22+
providers: [
23+
],
24+
imports: [
25+
FormsModule
26+
],
27+
exports: [
28+
FormsModule,
29+
FORMS_DIRECTIVES,
30+
]
31+
})
32+
export class NativeScriptFormsModule {
33+
}

nativescript-angular/hooks/hook-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ exports.getBeforeLivesyncHookDir = function getBeforeLivesyncHookDir() {
2929
};
3030

3131
exports.getHookFilePath = function getHookFilePath() {
32-
return path.join(exports.getBeforeLivesyncHookDir(), "nativescript-angular-sync .js");
32+
return path.join(exports.getBeforeLivesyncHookDir(), "nativescript-angular-sync.js");
3333
};

0 commit comments

Comments
 (0)