答案 0 :(得分:3)
使用不安全的
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="messagesReadController">
<button class="btn bg-info" ng-click="insertReplyBox()">Reply</button>
<br>
<div class="row">
<div class="col-lg-2" id="replyBox">
<div ng-bind-html="replyBoxHTML"></div>
<div ng-bind-html="replyBoxHTML1| unsafe" ></div>
</div>
</div>
</body>
</html>
&#13;
{{1}}&#13;
答案 1 :(得分:1)
我认为你的做法是错误的,使用angularJS你应该避免最大限度地使用DOM(指令除外)
这个怎么样?
<button class="btn bg-info" ng-click="textareashow = !textareashow">Reply</button>
<br>
<div class="row" ng-show="textareashow">
<div class="col-lg-2" id="replyBox">
<textarea col="4" row="20" placeholder="placeholder"></textarea>
</div>
</div>