1

ParentPage.html

<records-grid-column ng-change="validateData()" ng-model="name">                     
        {{item.name}}  </records-grid-column>  

Directive controller

   directive = {
    restrict: 'E',
    controller: ABCD,
    scope: {
        ngModel:'=',
        ngChange:'&',
        class:'='
    },
    transclude: true,
    replace: true,
    template: '<td class></td>'
};

return directive;

Edit - I changed Modal to model but still i am getting same error ...

Function validateData() is on parent page but on page load i am getting this error - 'Error: [Error] [$compile:ctreq] Controller 'ngModel', required by directive 'ngChange', can't be found!'

I tried everything but not able to resolve the issue, overall i just to want to call a function to validate the data after its edited and for that i am using 'ngChange'. Please let me know where i am wrong, Would be very thankful for help :)

Olivia
  • 125
  • 4
  • 13

1 Answers1

0

Change

From

  scope: {
        ngModal:'=',
        ngChange:'&',
        class:'='
    }

To

scope: {
    ngModel:'=',
    ngChange:'&',
    class:'='
}
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • 1
    I changed but still same error - 'Error: [Error] [$compile:ctreq] Controller 'ngModel', required by directive 'ngChange', can't be found!' – Olivia Jul 21 '17 at 10:56