2016-09-19 8 views
0

私はsqlserverに格納されているmathml形式の方程式を持っています。 linqを使用して、リストにUIに方程式を渡しています。 UIで私はng-repeatを使用してそれらのmathml文字列をレンダリングしようとしましたが、まったく動作しません。angularjsでng-repeatを使ってmathmlをレンダリングする方法は?

when i am directly putting the mathml string inside any div its rendering equations correctly.

In ng-repeat it showing the mathml format as it is.

MathMLの文字列は、多分それは良いアイデアは、このディレクティブを使用します

<math xmlns="http://www.w3.org/1998/Math/MathML"> 
    <mroot> 
     <mn>4</mn> 
     <mn>2</mn> 
    </mroot> 
    <mo>+</mo> 
    <mfrac> 
     <mn>5</mn> 
     <mn>2</mn> 
    </mfrac> 
    <mo>&#xA0;</mo> 
    <mo>=</mo> 
    <mo>&#xA0;</mo> 
    <mfenced open="[" close="]"> 
     <mtable> 
      <mtr> 
       <mtd> 
        <mn>2</mn> 
       </mtd> 
       <mtd> 
        <mn>2</mn> 
       </mtd> 
      </mtr> 
      <mtr> 
       <mtd> 
        <mn>8</mn> 
       </mtd> 
       <mtd> 
        <mn>4</mn> 
       </mtd> 
      </mtr> 
     </mtable> 
    </mfenced> 
</math> 

答えて

0

です: ngMathJax

それが働くだろう方法の例:

<div ng-math-jax> 
 
<math xmlns="http://www.w3.org/1998/Math/MathML"> 
 
    <mroot> 
 
     <mn>4</mn> 
 
     <mn>2</mn> 
 
    </mroot> 
 
    <mo>+</mo> 
 
    <mfrac> 
 
     <mn>5</mn> 
 
     <mn>2</mn> 
 
    </mfrac> 
 
    <mo>&#xA0;</mo> 
 
    <mo>=</mo> 
 
    <mo>&#xA0;</mo> 
 
    <mfenced open="[" close="]"> 
 
     <mtable> 
 
      <mtr> 
 
       <mtd> 
 
        <mn>2</mn> 
 
       </mtd> 
 
       <mtd> 
 
        <mn>2</mn> 
 
       </mtd> 
 
      </mtr> 
 
      <mtr> 
 
       <mtd> 
 
        <mn>8</mn> 
 
       </mtd> 
 
       <mtd> 
 
        <mn>4</mn> 
 
       </mtd> 
 
      </mtr> 
 
     </mtable> 
 
    </mfenced> 
 
</math> 
 
</div>

関連する問題