One of my directives is causing an error when I try to use it:
directive('myDirective',
function() {
return {
restrict: 'EA',
scope: {
params: '=ngModel'
},
//template: '',
templateUrl: '/myTemplate.html',
controller: 'myController',
link: function(scope, iElement, iAttrs, ngModel) {
// code..
}
};
}
);
After implementing this directive, I encountered the following console error: $compile:ctreq, with a hyperlink leading to this message: Missing Required Controller error in component $compile The directive 'myDirective' requires the 'ngModel' controller, which cannot be found!
The error disappears if I switch from using "templateUrl" to just "template", but I prefer not to use the latter. This issue appears to be a known bug: https://github.com/angular/angular.js/issues/4603
Any suggestions for a solution? Edit: I am utilizing ngModel for two-way data binding