今天尝试了一下angularjs的指令,发现就是出不来,找了一同发现问题原来出现在语法上面
一下是代吗截图
解决的问题很简单:只需要把return的括弧更改一下位置,
<script>
var app=angular.module('app',[]);
app.directive('zhiLing',function(){
return{
restrict:'E',
replace:true,
template:'<h1>只是一个连接</h1>'
//template:'color:red'
};
});
</script>
再次运行发现问题解决