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

Error: Uncaught (in promise): No value accessor for #41

Open
jeswinjames24 opened this issue Jul 3, 2016 · 5 comments
Open

Error: Uncaught (in promise): No value accessor for #41

jeswinjames24 opened this issue Jul 3, 2016 · 5 comments
Assignees

Comments

@jeswinjames24
Copy link

I get the below error when using ngForm as per RC4.

Error: Uncaught (in promise): No value accessor for 'email'

  <form  class="login-form" (ngSubmit)="login(loginForm.value)" #loginForm="ngForm">
            <paper-input [(ngModel)]="model.email" name="email" #email="ngModel" [(value)]="model.email"   name="email" label="E-Mail"></paper-input>
            <paper-input [(value)]="model.password" [(ngModel)]="model.password" name="password" #password="ngModel" type="password" label="Password"></paper-input>
             <button type="submit" class="btn waves-effect waves-light col s12"  block >Login</button>
         </form>

but the value is passed to the login().

If i remove the [(ngModel)]= and #email="ngModel" there is no errors but no values is being passed to the login().

@Saulis
Copy link
Contributor

Saulis commented Jul 29, 2016

Hi!

Are you using the latest version?

Also, please see #43

@jeswinjames24
Copy link
Author

Hi Saulis,

The version i am using currently is "@vaadin/angular2-polymer": "^1.0.0-beta2"

The issue still remains, the error can be removed with using only [(value)], but in this case the values of the form is not passed in submit function. I have to reference each value seperately.

@platosha
Copy link
Owner

Is it that you are using the Angular’s New Forms module? If so, this should be fixed by #55. Please try again with the master version of @vaadin/angular2-polymer.

@niveo
Copy link

niveo commented Sep 22, 2016

In my case, PolymerElement don't works with AppModule for all modules.

I need import PolymerElement('paper-input') in all modules.

I use static class and works.

polymer.ts
import { PolymerElement } from '@vaadin/angular2-polymer';
export class Polymer {
  static forRoot() {
    return [
      PolymerElement('paper-checkbox'),
      PolymerElement('paper-input'),
    ]
  }
}
import { Polymer } from 'polymer';

login.ts
@NgModule({declarations: [LoginComponent, Polymer.forRoot() ]})
export class LoginModule { }

map.ts
@NgModule({declarations: [MapComponent, Polymer.forRoot() ]})
export class MapModule { }

@Saulis
Copy link
Contributor

Saulis commented Oct 3, 2016

@jeswinjames24 is this still an issue for you with the v1.0.0-beta5 and ng2 final?

@niveo not sure if your problem is related with the original issue? If not, please file a new issue.

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

4 participants