嗨,我知道这是一个简单的问题,你怎么能在指令模板中插入一个新行?我有一个很长的模板。而且我很难水平扫描。我想要一个新的线。但角度不想要。如何在angular.js中的指令模板中插入新行?
app.directive('broadcasted', function(){
return{
restrict: 'EAC',
// NEW LINE THE TEMPLATE NOT JUST IN A SINGLE LINE
template: '<div class="alert alert-success col-md-6" ng-repeat="x in bcards"><strong class="broadcast-text" ><% x.q_number %> - <% x.teller_id %></strong></div>',
link: function($scope){
}
};
});
您是否尝试过使用
? –
为什么不加载模板文件,如果你想让它可读 – binariedMe