1

I'm developing a Quiz application where i want to use jqMath script to display the maths equations. Problem is that there is syntax conflict whenever i use curly braces other than that all equation format are working fine. I have tried interpolation provider but its still the same. How can i solve this. please help!

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>
user25285
  • 11
  • 3

1 Answers1

0

I haven't used angular, but it appears that it is triggered by double curly braces. To avoid this, try putting a space between the two braces, i.e. { { for {{, or } } for }}. jqMath will ignore the space inside mathematics.

Dave Barton
  • 1,429
  • 13
  • 12
  • I've tried your suggestion but it still the same. I know the problem is caused by angular delimiter "{ }" . If i can change this delimiter to some other symbol this problem might fix . The other way is to change the grouping symbol "{ }" used in jqMath .. – user25285 Sep 11 '17 at 17:48
  • Ouch. It appears you could use ngNonBindable, or change the angular delimiter as you suggest. You can't change the "{}" characters in jqMath. See https://stackoverflow.com/questions/16868024/how-do-i-escape-curly-braces-for-display-on-page-when-using-angularjs. – Dave Barton Sep 12 '17 at 19:30