Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datepicker No value accessor for '' error still there after updating to 1.0.20 ... #722

Closed
rernens opened this issue Jul 12, 2016 · 21 comments

Comments

@rernens
Copy link

rernens commented Jul 12, 2016

After upgrading to Angular 2.0.0 RC 4 and ng2-bootstrap 1.0.20, despite issue #678 being merged in version, issue #680 is still there.

I can't get the sample from your web site to work and always get the « No value accessor for '' » exception

platform-browser.umd.js:1900 Error: No value accessor for ''
at new BaseException (exceptions.ts:21)
at _throwError (shared.ts:68)
at Object.setUpControl (shared.ts:39)
at NgModel._setUpStandalone (ng_model.ts:83)
at NgModel._setUpControl (ng_model.ts:73)
at NgModel.ngOnChanges (ng_model.ts:43)
at DebugAppView._View_TeetimesComponent0.detectChangesInternal (TeetimesComponent.template.js:260)
at DebugAppView.AppView.detectChanges (core.umd.js:12143)
at DebugAppView.detectChanges (core.umd.js:12247)
at DebugAppView.AppView.detectViewChildrenChanges (core.umd.js:12169)

@Dinistro
Copy link
Contributor

@rernens Did you provide the new forms and disabled the deprecated once?

@valorkin
Copy link
Member

@rernens please add this 2 lines to application bootstrap
https://github.com/valor-software/ng2-bootstrap/blob/development/demo/index.ts#L57-L58
and use ngModel\FORM_DIRECTIVES from @angular/forms

@rernens
Copy link
Author

rernens commented Jul 12, 2016

I am effectively using the new form and have properly disabled the old one as per the @valorkin comments.

@valorkin
Copy link
Member

@rernens so it works now?

@rernens
Copy link
Author

rernens commented Jul 12, 2016

@valorkin I was already using the new form since RC 3. Had already applied your 2 lines before reporting the problem.
No the problem is still there.
I have a similar problem with ngFormControl also getting the same exception.
What does that mean ?

@valorkin valorkin reopened this Jul 12, 2016
@valorkin
Copy link
Member

Can you create a plunkr?

@adamduren
Copy link

I am experiencing this problem as well but for the Typeahead component. Should I open another issue?

@valorkin
Copy link
Member

Not really, please check steps I was mentioning earlier

@adamduren
Copy link

I followed those steps and the outcome was the same. I did a little more digging to try to figure out what exactly it was and it appears that it has to do with Ionic and the <ion-input> directive. When I converted it to a regular input it worked fine. Any ideas?

@adamduren
Copy link

Ok in my case it appears to be this bug ionic-team/ionic-framework#7217. I removed the typeahead directives with the exception of ngModel and the issue remained. Any chance you are using Ionic 2 as well @rernens?

@Dinistro
Copy link
Contributor

Dinistro commented Jul 13, 2016

@valorkin @adamduren @rernens I fixed this for the typeaheads. If I have enough time, I will apply these changes to every directive that uses ngModel.
See #723

@rernens
Copy link
Author

rernens commented Jul 13, 2016

@adamduren No I am not using Ionic 2. I am using the advanced-seed with nativescript support but the problem appears in the web part. Not yet tested on nativescript.

@rernens
Copy link
Author

rernens commented Jul 13, 2016

@valorkin Do you still nee a plunkr, if yes I will create one.

@Dinistro
Copy link
Contributor

@rernens We don't need a plunkr, I now exactly what the problem is.

@rernens
Copy link
Author

rernens commented Jul 13, 2016

@Dinistro OK, looking forward for your solution. Thanks

@rernens
Copy link
Author

rernens commented Jul 13, 2016

@Dinistro I finally found where the issue was, not a bug in datepicker :

import {disableDeprecatedForms, provideForms} from '@angular/forms';

not

import {disableDeprecatedForms, provideForms} from '@angular/forms/index';

@rernens rernens closed this as completed Jul 13, 2016
@Dinistro
Copy link
Contributor

@rernens there is another issue, if you use the directives without ngModel.

@davidgfolch
Copy link

ng2-bootstrap need to be updated to 1.0.22 for @angular/forms compatibility

@rernens
Copy link
Author

rernens commented Jul 14, 2016

@Dinistro OK thanks for the info.
In my case I am using the directive with ngModel so I have not noticed this issue.

@msklvsk
Copy link

msklvsk commented Jul 14, 2016

Happens for me with radio button. Latest everything, importing from @angular/forms, bootstrapping disableDeprecatedForms() and provideForms(). Is it more likely that I'm missing something or the issue still exists?

@valorkin
Copy link
Member

@msklvsk > ng2-bootstrap need to be updated to 1.0.22 for @angular/forms compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants