我正在试验指令。为什么下面的jsfiddle中的ng-transclude包含span元素而不仅仅是原始span的内容?我认为如果我设置了transclude:'element',它应该只包含span标签。
http://jsfiddle.net/tidelipop/DzVQ9/
var app = angular.module('MyApp', [], function($compileProvider){
$compileProvider.directive("inlineEdit", function(){
return {
restrict: "A",
transclude: true,
replace: true,
template: "<textarea ng-transclude></textarea>",
scope: true,
controller: function($scope){
toggleEditMode = function(){
$scope.editMode = !$scope.editMode;
}
}
};
});
})