AngularJS : How to say to a directive to clone scope?
问题 I have this fiddle, and can not make this work. I believe that the reason resides in that two li elements with a custom directive edit-in-place share scope. The solution would be to say to the directive to create a copy of the scope that binds on the parent - can transclude help? angular.module('bla', []) .directive('editInPlace', ['$parse','$compile', function($parse, $compile) { return { restrict: 'A', scope: true, link: function (scope, element, attribs) { var inputStart = '<input style=