material icon indicating copy to clipboard operation
material copied to clipboard

mdRadioGroup - Issue with ng-change for the radio button

Open Autushka opened this issue 11 years ago • 10 comments

I use v0.6.1. When I try to use ng-change derective for the radio button like:

{{'forgotPassword_userName' | translate}}

I'm getting an error in the concole: Error: [$compile:ctreq] http://errors.angularjs.org/1.3.6/$compile/ctreq?p0=ngModel&p1=ngChange

Br, Aleh

Autushka avatar Dec 16 '14 18:12 Autushka

@Autushka - plz provide a CodePen or Plunkr example.

ThomasBurleson avatar Dec 16 '14 19:12 ThomasBurleson

Hello Thomas

Here is the example at plnkr: http://plnkr.co/edit/XckbEvtIYlJKRMtbs8UC?p=preview As soon as ng-change directives are removed from html radio buttons start working.

Br, Aleh

Autushka avatar Dec 17 '14 16:12 Autushka

ng-change requires ng-model. If you try this:

    <md-radio-group ng-model="sSelectedResetType" ng-change="onTypeChange()">
        <md-radio-button value="userName">Username</md-radio-button>
        <md-radio-button value="email">Email</md-radio-button>
    </md-radio-group>

all works well.

ThomasBurleson avatar Dec 18 '14 04:12 ThomasBurleson

Documentation is incorrect. ngChange is listed as belonging to md-radio-button: https://material.angularjs.org/latest/api/directive/mdRadioButton

STOpandthink avatar Jan 15 '16 00:01 STOpandthink

+1

depyronick avatar Jan 20 '16 12:01 depyronick

+1 to @STOpandthink, thankfully I found this thread as I've been banging my head against the wall trying to work this out!

jvgeee avatar May 02 '16 06:05 jvgeee

+1.

yannicklerestif avatar Aug 05 '16 16:08 yannicklerestif

+1

cchen408 avatar Aug 11 '16 03:08 cchen408

+1

chris-carrington avatar Sep 13 '16 21:09 chris-carrington

I noticed this too, still an issue after a few months

bentaly avatar Nov 01 '16 17:11 bentaly