.directive('formComs',function(){
return {
restrict:'E',
template:''+
'{{item.title}}'+
''+
'
' ,
replace:true,
}
})
html:
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
根据 https://docs.angularjs.org/api/ng/directive/ngIf,
ng-if的值是expression。所以改成ng-if="item.name"就好了