/*显示条件表达式*/ var myConExpController=['$scope','$http','myCache',function($scope,$http,myCache) { //显示当前条件表达式 $scope.$on('showConExpEvent',function(event,data){ var len=data.length; var dataStr=""; if(len<=80){ // dataStr=data; }else{ //超长字符串需截断字符显示 var s=Math.ceil(len/80); var i=0; var start=0; var end=0; do{ start=i*80; end=(++i)*80; if(end>len){ end=len; } dataStr+=trimStr(data.substring(start,end)+"<br/>"); --s; }while(s>0); } $scope.conExpModel=trimStr(dataStr); }); }];
2、html
<td colspan="6" ng-controller="myConExpController" style="width: 550px;"> {{'PROPERTY.SEQUENCEFLOW.CONDITION.STATIC' | translate}}<br> <span ng-model="conExpModel" style="color: #444444;font-size: 14px;background-color: #f0f0f0;width: 550px;overflow: hidden;" ng-bind-html="conExpModel"></span> </td>原文链接:https://www.f2er.com/angularjs/147546.html