Components: Slide-Toggle on Latest Angular 2 (RC4) - EXCEPTION: No value accessor for ''

Created on 2 Jul 2016  Â·  13Comments  Â·  Source: angular/components

Browser returns an error when using [(ngModel)] on Slide-Toggle Component:

<md-slide-toggle color="primary" [(ngModel)]="sortMode">
   TOGGLE
  </md-slide-toggle>

EXCEPTION: No value accessor for ''

Angular 2 RC4

Most helpful comment

bootstrap(AppComponent, [
  disableDeprecatedForms(),
  provideForms()
 ])
 .catch((err: any) => console.error(err));

details here

The element need also a name to get it work with new forms

All 13 comments

@kara I guess that's already fixed within the latest changes in Material2? Because of the new forms in RC4.

Same issue with md-input rc4 and beta6

Forms version 0.1.0

First I had the same issue. After update to forms 0.2.0 everything is good.

Ok thx this also the solution also for md-input

Am Samstag, 2. Juli 2016 schrieb Neo11 :

First I had the same issue. After update to forms 0.2.0 everything is
good.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.<
https://ci3.googleusercontent.com/proxy/ka3ymmnI2TuvqYKgy184r5AEjgURnHE9ZFl9YPHbk-17o5wqKdDox0kBYAngCwCgvQMWE84is_kd8g1jkH_dmf2aRxCbwLh3zUEpR5jmHRIs3842fur_3yaligGElsJG7Cs8NKGiBZ6g6jeSGg1HBE4w4dLLig=s0-d-e1-ft#https://github.com/notifications/beacon/AQ8j8nKOxJVOEmV_p0gdHBFEQHaXPIiKks5qRszdgaJpZM4JDqwq.gif

Got the same error in forms 0.2.0 :(

Did you activate the new forms in bootstrap?

disableDeprecatedForms(),
provideForms(),

I did
import {provideForms} from '@angular/forms';
bootstrap(AppComponent, [ JwtService, HTTP_PROVIDERS, provideForms() ]);

bootstrap(AppComponent, [
  disableDeprecatedForms(),
  provideForms()
 ])
 .catch((err: any) => console.error(err));

details here

The element need also a name to get it work with new forms

Works thanks.

As long as you're using RC4 with forms 0.2.0 and are importing the new forms module properly, you should not get this error. Closing, as there doesn't seem to be a bug.

I think that should be explained in the get starting guide. It's not clear
that the components use forms.

Am Sonntag, 3. Juli 2016 schrieb Kara :

Closed #803.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.<
https://ci5.googleusercontent.com/proxy/-1zGXCR-Qh1wNdfkRLFILR7Io6r14lgcUCprvahcpdy8PbgItS5Pihe5OiIMuDOLRz1goZJNmzsOeczOpoicFMlIEhkKwLXQYN2DT4_3o8oZVKVM27fcC2aQ73oJT_dPLE-_W9YqgRZTtCQidyDCIz4kGWBcvA=s0-d-e1-ft#https://github.com/notifications/beacon/AQ8j8vo9_F44QyUzISmLI7R_wGi4lJ7Eks5qR-mrgaJpZM4JDqwq.gif

@elvirdolic That's a great idea. I added a section to the getting started guide explaining what's necessary to use version alpha.6 with forms: https://github.com/angular/material2/pull/810

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

Hiblton picture Hiblton  Â·  3Comments

theunreal picture theunreal  Â·  3Comments

constantinlucian picture constantinlucian  Â·  3Comments

michaelb-01 picture michaelb-01  Â·  3Comments