iframe 在rails怎么使用
发布网友
发布时间:2023-07-14 07:52
我来回答
共1个回答
热心网友
时间:2024-12-05 02:33
HTML代码:
<div ng-show="paragraph.show">
<span ng-click="addModify(paragraph)" class="glyphicon glyphicon-plus"></span>
</div>
<div ng-show="!paragraph.show">
<div class="input-group">
<div class="input-group-addon">
<span class="glyphicon glyphicon-globe" ng-click="addModify(paragraph)"></span>
</div>
<input ng-model="paragraph.modifyURL" type="text" class="form-control" placeholder="Please input the URL.">
</div>
<div class="">
<p>{{paragraph.modifyURL}}</p>
<iframe width="100%" height="100%" seamless frameborder="0" ng-src="{{trustSrc(paragraph.modifyURL)}}" ></iframe>
</div>
</div>
JS代码
$scope.trustSrc = (url) ->
$sce.trustAsResourceUrl(url)
$scope.addModify = (paragraph) ->
paragraph.show = !paragraph.show