javascript - How do I create an isolate scope of the directive's module name? -


i have directive called contenteditable isolate scope called post: "&"

question:

how can replace isolated scope called post default contenteditable directive.

angular.module('t23app'). directive("contenteditable", function() {     return {         restrict: "a",         require: "ngmodel",         scope: {             post: "&"         },         link: function(scope, element, attrs, ngmodel) {             console.log(contenteditable)             function read() {                 ngmodel.$setviewvalue(element.html());             }              ngmodel.$render = function() {                 element.html(ngmodel.$viewvalue || "");             };              element.bind("blur keyup change", function() {                 scope.$apply(read);             });         }     }; }); 

therefore: looks this

<div contenteditable post="dosomething()"> click this</div> 

in end html :

<div contenteditable="dosomething()"> click this</div> 

put name of directive in scope:

scope: {   contenteditable: "&" } 

Comments