Components: md-radio-group "No value accessor for x"

Created on 28 Apr 2016  路  5Comments  路  Source: angular/components

I'm trying to use md-radio-group, like this

<form [ngFormModel]="form">
  <md-radio-group
    [ngModel]="data.foo"
    ngControl="foo">
    <md-radio-button *ngFor="#option of radioButtonOptions" [value]="option.value">
      {{ option.label }}
    </md-radio-button>
  </md-radio-group>
</form>

along with

class WhateverCmp {
  public data = { foo: null };

  public radioButtonOptions = [
    {
      label: 'Bar',
      value: 'bar'
    },
    {
      label: 'Baz',
      value: 'baz'
    }
  ];

  constructor(private _fb: FormBuilder) {
    this.form = _fb.group({
      foo: [ '', Validators.required ]
    });
  }

}

and I'm getting ORIGINAL EXCEPTION: No value accessor for 'foo'

using alpha.3 and angular b.16

Most helpful comment

You have to include MdRadioGroup in the directives

All 5 comments

@fxck this is working for me when tested against the latest code in master. Closing for now - please let me know if this is not resolved and I will reopen.

I am experience this issue as well.

Using:
@angular/core: "2.0.0-rc.1"
@angular2-material/core: "^2.0.0-alpha.4"
@angular2-material/radio: "^2.0.0-alpha.4"

http://plnkr.co/edit/sMHZESGaE4qjHCshmnzO?p=preview

@robertmesserle well it's not working on whatever is released on npm, http://plnkr.co/edit/uM0WoalscT5Cx4XFev5V?p=preview

You have to include MdRadioGroup in the directives

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alanpurple picture alanpurple  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

Miiekeee picture Miiekeee  路  3Comments

RoxKilly picture RoxKilly  路  3Comments

crutchcorn picture crutchcorn  路  3Comments