angular-polymer icon indicating copy to clipboard operation
angular-polymer copied to clipboard

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

Open jeswinjames24 opened this issue 9 years ago • 5 comments

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().

jeswinjames24 avatar Jul 03 '16 16:07 jeswinjames24

Hi!

Are you using the latest version?

Also, please see #43

Saulis avatar Jul 29 '16 07:07 Saulis

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.

jeswinjames24 avatar Aug 01 '16 06:08 jeswinjames24

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.

platosha avatar Aug 23 '16 11:08 platosha

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 { }

niveo avatar Sep 22 '16 15:09 niveo

@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.

Saulis avatar Oct 03 '16 12:10 Saulis