如何在角度应用程序中使用jqmath脚本?

时间:2017-09-10 18:45:35

标签: angular jqmath

我正在开发一个Quiz应用程序,我想使用jqMath脚本来显示数学方程式。问题是每当我使用大括号时都存在语法冲突,而不是所有方程格式都正常工作。我已经尝试了插值提供程序,但它仍然是相同的。我怎么能解决这个问题。请帮忙!

Uncaught Error: Template parse errors:Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) (" Invalid ICU message. Missing '}'. ("

import {parseMath} from 'jqmath';

export class A{
  
  @ViewChild('exp') exp:ElementRef;
  
  func{
    var  exp = this.exp.nativeElement;     
    parseMath(exp);
  }
  
}
<div class="exp" #exp >$$x={-b±√{b^2-4ac}}/{2a}$$</div>

1 个答案:

答案 0 :(得分:0)

我没有使用过角度,但看起来它是由双花括号触发的。为避免这种情况,请尝试在两个大括号之间添加一个空格,即{ {{{} }}}。 jqMath将忽略数学中的空间。

相关问题