在 angularJS 1.3.14
var app = angular.module('myApp',[]);
app.controller('myController',['$scope',function($scope){
$scope.name = 'world';
}]);
//here i created directive of name helloWorld
app.directive('helloWorld',function(){
return {
replace:true,
restrict:'AE',
template :'<h3>Hello world<h3/>'
}
});
<html ng-app='myApp'>
<body ng-controller = "myController">
<hello-world/>
</body>
</html>
错误:[$compile:tplrt] 指令“helloWorld”的模板必须只有一个根元素。
如何解决这个错误?