ngModel is broken in beta 9

I have updated to beta 9 and introduced the new form lib to my app.
All works good except for ngModel. Whenever I try to use it with an ion-component like ion-toggle or ion-segment I get the following error.

EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in build/pages/home/home.html:13:24
ORIGINAL EXCEPTION: No value accessor for ''
ORIGINAL STACKTRACE:
Error: No value accessor for ''
    at new BaseException (http://localhost:9999/build/js/app.bundle.js:108803:24)
    at _throwError (http://localhost:9999/build/js/app.bundle.js:110435:12)
    at Object.setUpControl (http://localhost:9999/build/js/app.bundle.js:110410:10)
    at NgModel._addStandaloneControl (http://localhost:9999/build/js/app.bundle.js:111097:19)
    at NgModel._addControl (http://localhost:9999/build/js/app.bundle.js:111093:19)
    at NgModel.ngOnChanges (http://localhost:9999/build/js/app.bundle.js:111051:19)
    at DebugAppView._View_HomePage0.detectChangesInternal (HomePage.template.js:201:47)
    at DebugAppView.AppView.detectChanges (http://localhost:9999/build/js/app.bundle.js:15351:15)
    at DebugAppView.detectChanges (http://localhost:9999/build/js/app.bundle.js:15456:45)
    at DebugAppView.AppView.detectViewChildrenChanges (http://localhost:9999/build/js/app.bundle.js:15377:20)
ERROR CONTEXT:
[object Object]

image

It works for me in beta 9

I am seeing the same thing with ion-segment in Beta 10 (and also introduced the new form lib to my app) and was wondering if this is a known issue and if so if there is a workaround.

EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in build/pages/tab-challenges/tab-challenges.html:16:21
ORIGINAL EXCEPTION: No value accessor for ''
ORIGINAL STACKTRACE:
Error: No value accessor for ''
    at new BaseException (http://localhost:8100/build/js/app.bundle.js:48926:23)
    at _throwError (http://localhost:8100/build/js/app.bundle.js:47982:11)
    at Object.setUpControl (http://localhost:8100/build/js/app.bundle.js:47957:9)
    at NgModel._setUpStandalone (http://localhost:8100/build/js/app.bundle.js:46857:18)
    at NgModel._setUpControl (http://localhost:8100/build/js/app.bundle.js:46849:37)
    at NgModel.ngOnChanges (http://localhost:8100/build/js/app.bundle.js:46808:18)
    at DebugAppView._View_TabChallengesPage0.detectChangesInternal (TabChallengesPage.template.js:597:48)
    at DebugAppView.AppView.detectChanges (http://localhost:8100/build/js/app.bundle.js:40734:14)
    at DebugAppView.detectChanges (http://localhost:8100/build/js/app.bundle.js:40839:44)
    at DebugAppView.AppView.detectViewChildrenChanges (http://localhost:8100/build/js/app.bundle.js:40760:19)
ERROR CONTEXT:
[object Object]

with the following:

export class TabChallengesPage {
  // Definitions
  private challengetype: string = "all";

and

    <ion-toolbar [attr.primary]="isAndroid ? '' : null" class="challenges-segments">
        <ion-segment [(ngModel)]="challengetype" [attr.light]="isAndroid ? '' : null">
            <ion-segment-button value="all">
                All
            </ion-segment-button>
            <ion-segment-button value="active">
                Active
            </ion-segment-button>
            <ion-segment-button value="open">
                Open
            </ion-segment-button>
            <ion-segment-button value="done">
                Done
            </ion-segment-button>
        </ion-segment>
    </ion-toolbar>

Your problem lies elsewhere, as that snippet works fine for me.

If I disable provideForms in my ionicBootstrap call it works fine. It’s only when the new forms handling is added that the issue appears.

ionicBootstrap(
  MyApp, 
  [
    disableDeprecatedForms(),
    //provideForms(),

I don’t believe new forms are supported in a released version of Ionic yet, only in master.

Appreciate the response. That would explain the issue on my end. I saw the Angular note in the console after I upgraded and assumed I would need to convert all of my forms etc.

If you’re impatient and have already converted a bunch of forms, you may be interested in this discussion.