我有以下 HTML:
<div style="border:1px solid; height:300px; width:500px; position:relative; left:100px" id="canvas">
<tbox ng-repeat="tb in textBoxes" ng-model="tb">
</tbox>
</div>
以及以下 2 个指令
appModule.directive('resizable', function($compile, $document) {
return {
restrict: "A",
template: '<div ng-style="{top:tb.x, left:tb.y, height:tb.height, width:tb.width}" ng-transclude><span class="scale">s</span></div>',
transclude: true,
replace: true,
require: 'ngModel'
}
});
appModule.directive('tbox', function($document) {
return {
restrict: "E",
template: '<div class="editbox" resizable editoptions>{{tb.text}}</div>',
replace: true
}
});
angular 抛出的以下错误到底是什么意思?
Error: Multiple directives [tbox, resizable] asking for template on: <div class="editbox" resizable="" editoptions="" ng-repeat="tb in textBoxes" ng-model="tb">
jsfiddle 在http://jsfiddle.net/sEZM3/