AngularJs输出字符串换行\n或<br/>不管用时,要用ng-bind-html配合解决
来源:互联网 发布:阿里云境外断网 编辑:程序博客网 时间:2024/06/04 20:12
1、controller
2、html
/*显示条件表达式*/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>
0 0
- AngularJs输出字符串换行\n或<br/>不管用时,要用ng-bind-html配合解决
- 【Html基础】之<h1>~<h6> <p> <br> <hr>
- 【Html基础】之<h1>~<h6> <p> <br> <hr>
- 换行问题(out.println与<br>)
- js内\n替换为<br/>
- js内\n替换为<br/>
- angularjs中ng-bind-html使用问题
- AngularJs ng-bind-html指令整理
- 解决AngularJS使用ng-bind-html会过滤html中style属性的问题
- 解决AngularJS使用ng-bind-html会过滤html中style属性的问题
- HTML <br>换行标签
- velocity 替换\n 换行符 为html <br />
- angularJS中把html格式的字符串转成html格式显示,ng-bind-html与trustAsHtml的过滤器
- angularjs ng-bind-html 指令 对html标签转译
- <html:errors/>
- AngularJS 2 中如何实现ng-bind-html
- angularJs 中的ng-bind-html指令和$sce服务
- AngularJS 2 中如何实现ng-bind-html
- SpringMVC源码剖析(四)- DispatcherServlet请求转发的实现
- java project export 工程jar包单独运行(bat文件)
- java通过JNDI连接数据源
- mybatis直接执行前台传递的sql语句(mapper参数即为sql字符串)
- 51nod 1031骨牌覆盖
- AngularJs输出字符串换行\n或<br/>不管用时,要用ng-bind-html配合解决
- CSS中,float浮动的理解
- 解决BootStrap Table表格中含中文时点击导出数据无响应的问题(Uncaught INVALID_CHARACTER_ERR: DOM Exception 5)
- angularjs中My97DatePicker无法通过$scope.ngModel获取值解决
- Android原生计算器禁止输入多个无效0的修改方案
- Thread.sleep的作用
- 【JavaEE】JDBC基本技术
- java四种线程池
- java实现最大字段和的动态规划解法