Skip to content

[button-toggle-group] bound to NgModel throws error if multiple selection is used #1039

@RoxKilly

Description

@RoxKilly

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When <button-toggle-group multiple [(ngModel)]="property"> is used, the model property should be updated with a list (object or array) of values selected in the toggle group.

Alternatively, improve the docs with a note that the ngModel binding is not supported in multiple selection mode.

What is the current behavior?

The app crashes with error: No value accessor for form control. The same code works when group is in exclusive selection mode

What are the steps to reproduce?

See this plunker. The app will not run unless you remove the multiple attribute from the toggle group in /app/app.component

What is the use-case or motivation for changing an existing behavior?

It's a bug

Which versions of Angular, Material, OS, browsers are affected?

Angular 2 rc.5, Material 2 alpha 7-2

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions