angular-polymer
angular-polymer copied to clipboard
Error: Uncaught (in promise): No value accessor for
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().
Hi!
Are you using the latest version?
Also, please see #43
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.
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.
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 { }
@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.