question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mmgycecommented, Jun 8, 2016

You have to include MdRadioGroup in the directives

1reaction
mashhoodrcommented, May 20, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

<mat-radio-button> : No value accessor - Stack Overflow
Try to set formControlName="SearchType" on <mat-radio-group> and not on <mat-radio-button> .
Read more >
angular/material2 - Gitter
CreateQuestion class CreateQuestion - inline template:13:39 caused by: No value accessor for form control with name: 'choice'.
Read more >
Material radio-button, getting "ERROR Error: No value ... - Reddit
I am trying to use material radio buttons in a reactive form but get the error message ERROR Error: No value accessor for...
Read more >
UNPKG - @angular/material
When this module is loaded\n * without NoConflictStyleCompatibilityMode ... n * @param {?} x Coordinate within the element, along the X axis at...
Read more >
Angular Material Mat-Radio-Button Default Checked Not ...
get Error: ERROR Error: No value accessor for form control with name: 'gender' mat-radio-button should support formControlName withiout parrent radio ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found