Zumm Zumm - 5 months ago 16
AngularJS Question

Required directive controller is not present on the current DOM element

So I was wondering what actually "required directive controller is not present on the current DOM element" means
here is the link of error:https://docs.angularjs.org/error/$compile/ctreq?p0=ngModel&p1=contenteditable

Answer

You are missing the ngModel directive for your custom directive.

Try something like this:

app.directive('contenteditable', function () {
    return {
        restrict: 'E',
        require: 'ngModel',
        link: function (scope) {

          // do something
        }
    };
});

and in your HTML file add ng-model

<contenteditable ng-model="name"></contenteditable> 
Comments