-
Notifications
You must be signed in to change notification settings - Fork 44
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
Checkbox is not checked using value attribute #45
Labels
Milestone
Comments
Should be <p>
Value of test: {{test}}
<paper-checkbox [(checked)]="test">Template</paper-checkbox>
</p> |
That does the trick but then you still can not use the ngControl directive for model driven forms <p>{{form.value | json}}</p>
<form [ngFormModel]="form">
<paper-input label="Name" ngControl="name" error-message="Max 10 chars"></paper-input>
<paper-checkbox ngControl="classic">Classic</paper-checkbox>
</form> import { Component } from '@angular/core';
import { ControlGroup, FormBuilder, Validators } from '@angular/common';
import { PolymerElement } from '@vaadin/angular2-polymer';
@Component({
moduleId: module.id,
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
directives: [
PolymerElement('paper-button'),
PolymerElement('paper-checkbox'),
PolymerElement('paper-input'),
]
})
export class AppComponent {
private form: ControlGroup;
private car = {
name: '',
classic: true
};
constructor(private fb: FormBuilder) {
}
public ngOnInit(): void {
this.form = this.fb.group({
name: [this.car.name, Validators.maxLength(10)],
classic: [this.car.classic]
});
}
} |
Added a feature to target |
Fixed in #62 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: