Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-change is throwing error [$compile:ctreq]

I am using angularjs 1.2.14, the code is working fine without ng-change. As soon as i add the code for ng-change in checkbox. it throws the error.

Error: [$compile:ctreq] http://errors.angularjs.org/1.2.14/$compile/ctreq?p0=ngModel&p1=ngChange at Error (native)..... 

Can anyone please help? Thanks in advance.

like image 398
mulla.azzi Avatar asked Mar 14 '14 11:03

mulla.azzi


2 Answers

to use ng-change in your element you should also specify ng-model which i had missed. Thanks for your time.

like image 57
mulla.azzi Avatar answered Oct 04 '22 01:10

mulla.azzi


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

See working sample.

ng-change requires ng-model, without it will not work

like image 21
Eugene P. Avatar answered Oct 04 '22 01:10

Eugene P.