PeterStaev / nativescript-masked-text-field

:hash: A NativeScript Masked Text Field widget
Apache License 2.0
25 stars 24 forks source link

Cannot use in NS Forms 3.4.0 #18

Closed jaime-marcondes closed 6 years ago

jaime-marcondes commented 6 years ago

I've tried to upgrade your plugin to 2.0.0, after upgrading the NS to 3.4.0. It shows this error on app.module.ts:

Type TextValueAccessor is part of the declarations of 2 modules: NativeScriptFormsModule and MaskedTextFieldModule! Please consider moving TextValueAccessor to a higher module that imports NativeScriptFormsModule and MaskedTextFieldModule. You can also create a new NgModule that exports and includes TextValueAccessor then import that NgModule in NativeScriptFormsModule and MaskedTextFieldModule.

Does you have any tips for using the new version with NativesScript 3.4 ?

Thank's

vtjon commented 6 years ago

I believe it's just necessary to delete this line in the angular/index.ts file: https://github.com/PeterStaev/nativescript-masked-text-field/blob/master/angular/index.ts#L40

PeterStaev commented 6 years ago

I will have to check this. It is not simply deleting the line, because w/o that line there were compile problems 😢

vtjon commented 6 years ago

Thanks for looking so quickly. I just manually edited the index.js file in my project to remove the declaration as a quick test and it worked. Of course, this isn't the ultimate solution as the TS needs to compile.

jaime-marcondes commented 6 years ago

Thank for quickly response, vtjon and Peter. We'll tried that solution for now.

PeterStaev commented 6 years ago

@jaime-marcondes , @vtjon please try version 2.0.1 now available on npm. It should have this problem resolved.

vtjon commented 6 years ago

Thanks @PeterStaev. It seems to be working for me.

jaime-marcondes commented 6 years ago

@PeterStaev, Thank you!. It's working now, tested with NS Forms 3.4.0