2017-09-26 5 views
1

私はtootltiptrusashtmlも使用していますが、テキストはHTMLに解析されない文字列として表示されます。htmlタグがuib-tooltip内で動作しない

HTML:

<label uib-tooltip="{{TooltipText}}" 
     tooltip-enable="!showEditHours" 
     for="IsAttested" 
     ng-class="{'Cursor_Auto': !showEditHours}">Text</label> 

コントローラー:

$scope.ad = { 'text': 'This attestation is editable only when the <b> Hours of the Accounting Firm of the Issuer </b> section has been enabled for edit. Please click on the Edit <b> Hours of the Accounting Firm of the Issuer </b> button.' }; 
$scope.TooltipTextAttestationFinalName = $sce.trustAsHtml($scope.ad.text); 

答えて

0

あなたは2つのオプションがあります。

uib-tooltip-html最初は、documentationに従って、html文字列に評価される式を取る指示文を使用することです。

<label uib-tooltip-html="TooltipText" 
    tooltip-enable="!showEditHours" 
    for="IsAttested" 
    ng-class="{'Cursor_Auto': !showEditHours}">Text</label> 

他のテンプレートパスに解決式を取りuib-tooltip-templateにある:これは、あなたが探しているものと考えられます。

+1

を試してみてください。 –

+0

これの背後にある理由は何ですか? –

+1

'UIB-ツールチップ-html'ディレクティブは、入力として、角度表現がかかりますが、' {{SOMEVARは}} '実際ディレクティブに渡す前に式を評価し、その指示のみ(文字列だと、再びそれを評価しようとします失敗する)。例として、あなたは '$ scope.someVar =宣言している場合は、舞台裏、' 'ツールチップディレクティブ試行「これはstring''であり、この 'UIB-ツールチップ-htmlの=のようにそれを渡す」{{SOMEVAR}}これをやや使います: '$ scope ['これは文字列']ですが、明らかに動作しません。コメントで明確に説明するのは少し難しいです。 :-) –

0

はおかげで、私は再び感謝理由だったUIB-ツールチップ-HTML内の式を使用していたこの

<label uib-tooltip-html="{{TooltipText}}" 
     tooltip-enable="!showEditHours" 
     for="IsAttested" 
     ng-class="{'Cursor_Auto': !showEditHours}">Text</label 

コントローラ

$scope.ad = { 'text': 'This attestation is editable only when the <b> Hours of the Accounting Firm of the Issuer </b> section has been enabled for edit. Please click on the Edit <b> Hours of the Accounting Firm of the Issuer </b> button.' }; 
$scope.TooltipTextAttestationFinalName = $sce.trustAsHtml($scope.ad.text); 
+0

私は実際には、私はhtmlを使用する前に何も来ていない –

関連する問題