2016-10-20 2 views
1

私は角bootrapでポップオーバーウィンドウにタイトルのスタイルをHTMLを使用しようとしているが、ポップオーバー本体がHTMLのスタイリングを含めることができるので、それはプレーンテキストとして角度ブートストラップポポオーバーのタイトルにhtmlを使用することはできますか?

を登場だ、私はこれは

<!doctype html> 
<html ng-app="popover.title.html"> 
    <head> 
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js"></script> 
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-animate.js"></script> 
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-sanitize.js"></script> 
    <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.2.0.js"></script> 
    <script src="example.js"></script> 
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> 
    </head> 
    <body> 
<script type="text/javascript"> 
    angular.module('popover.title.html', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']); 
angular.module('popover.title.html').controller('htmlTitleCtrl', function ($scope, $sce) { 
    $scope.htmlPopover = $sce.trustAsHtml('<b style="color: red">I can</b> have <div class="label label-success">HTML</div> content'); 
}); 
</script> 
<div ng-controller="htmlTitleCtrl"> 
    <div style="padding-top: 15em; padding-left: 7em;"> 
     <button uib-popover-html="htmlPopover" popover-title="This is in <span style='color:red;'>red</span>" class="btn btn-default">HTML Popover</button> 
    </div> 
</div> 
    </body> 
</html> 
を働くだろうと思いました

実行plunkr:https://plnkr.co/edit/A1qwqnxOZwLCs05ePS38?p=preview

は、それは色がタイトルに正しく表示させることが可能ですか?

答えて

関連する問題