实际字符串 - •恢复团队是否已组装? •SLA的关键时间 - 现在是否会受到影响,如果事件延长的时间会延长?
请建议..
HTML code:
<div class="form-group has-feedback">
<textarea class="form-control form-control-BCC" name="Notes" ng-model="buisnessSaveCommunication.BusinessContinutiydata.KeyMessage" spellcheck="true"></textarea>
</div>
此处ng-model中的buisnessSaveCommunication是别名。
angularjs:
scope.BusinessContinutiydata.KeyMessage = scope.keyMessge;
答案 0 :(得分:1)
问题是您无法在textarea
/ input
框内直接显示已编码的实体。您可以做的是,在将值绑定到textarea
之前解码它。对于使用$sanitize
的{{1}}服务。只需将ngSanitize
传递给html
服务即可返回已解码的html。
$sanitize
&#13;
//Make sure you included `ngSanitize` module in your app module dependency
//Also add angular-sanitize.js with the same version that Angularjs has, otherwise it may conflict.
angular.module('app', ['ngSanitize'])
.controller('TestCtrl', function($scope, $sce, $sanitize) {
$scope.test = $sanitize('Critical timing for SLA's');
})
&#13;
否则,您只需要在将值绑定到<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular-sanitize.min.js"></script>
<body ng-app="app" ng-controller="TestCtrl">
<h1>{{test}}!</h1>
</body>
之前手动解码。您可以参考What's the right way to decode a string that has special HTML entities in it?获取相同的
在这种情况下,我希望您使用TextAngular
组件,它提供类似的功能和许多其他功能。