Skip to content

Commit 35e4864

Browse files
committed
fix(angular): {N} FormsModule fix for Ivy
1 parent 6667bce commit 35e4864

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

nativescript-angular/animations/animations.module.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,19 @@ export function instantiateDefaultStyleNormalizer() {
4848
return new WebAnimationsStyleNormalizer();
4949
}
5050

51-
export const NATIVESCRIPT_ANIMATIONS_PROVIDERS: Provider[] = [
52-
{provide: AnimationDriver, useFactory: instantiateSupportedAnimationDriver},
53-
{provide: AnimationBuilder, useClass: BrowserAnimationBuilder},
54-
{provide: AnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer},
55-
{provide: AnimationEngine, useClass: InjectableAnimationEngine},
56-
{
57-
provide: RendererFactory2,
58-
useFactory: instantiateRendererFactory,
59-
deps: [NativeScriptRendererFactory, AnimationEngine, NgZone]
60-
}
61-
];
62-
6351
@NgModule({
6452
imports: [NativeScriptModule],
65-
providers: NATIVESCRIPT_ANIMATIONS_PROVIDERS,
53+
providers: [
54+
{provide: AnimationDriver, useFactory: instantiateSupportedAnimationDriver},
55+
{provide: AnimationBuilder, useClass: BrowserAnimationBuilder},
56+
{provide: AnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer},
57+
{provide: AnimationEngine, useClass: InjectableAnimationEngine},
58+
{
59+
provide: RendererFactory2,
60+
useFactory: instantiateRendererFactory,
61+
deps: [NativeScriptRendererFactory, AnimationEngine, NgZone]
62+
}
63+
]
6664
})
6765
export class NativeScriptAnimationsModule {
6866
constructor(@Optional() @SkipSelf() parentModule: NativeScriptAnimationsModule) {

nativescript-angular/forms/forms.module.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ import {
99
SelectedIndexValueAccessor
1010
} from "./value-accessors";
1111

12-
export const FORMS_DIRECTIVES = [
13-
TextValueAccessor,
14-
CheckedValueAccessor,
15-
DateValueAccessor,
16-
TimeValueAccessor,
17-
SelectedIndexValueAccessor,
18-
NumberValueAccessor,
19-
];
20-
2112
export {
2213
TextValueAccessor,
2314
CheckedValueAccessor,
@@ -28,15 +19,27 @@ export {
2819
};
2920

3021
@NgModule({
31-
declarations: FORMS_DIRECTIVES,
22+
declarations: [
23+
TextValueAccessor,
24+
CheckedValueAccessor,
25+
DateValueAccessor,
26+
TimeValueAccessor,
27+
SelectedIndexValueAccessor,
28+
NumberValueAccessor
29+
],
3230
providers: [
3331
],
3432
imports: [
3533
FormsModule
3634
],
3735
exports: [
3836
FormsModule,
39-
FORMS_DIRECTIVES,
37+
TextValueAccessor,
38+
CheckedValueAccessor,
39+
DateValueAccessor,
40+
TimeValueAccessor,
41+
SelectedIndexValueAccessor,
42+
NumberValueAccessor
4043
]
4144
})
4245
export class NativeScriptFormsModule {

0 commit comments

Comments
 (0)