Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering code in Angular 2 template [duplicate]

Tags:

angular

I'm currently working on an Angular 2 application and need to display some C# code in an Angular 2 template which will later be styled using a syntax highlighter.

However, as soon as I drop the code into an Angular 2 template I get template parse errors as it tries to parse the C# and fail.

zone.js:355 Unhandled Promise rejection: Template parse errors: <code>...

What is the solution to this? Does Angular 2 include ability to ignore the code portions of my template?

like image 929
Joseph Woodward Avatar asked Oct 07 '16 11:10

Joseph Woodward


1 Answers

<code ngNonBindable>
  code here
</code>
like image 165
Günter Zöchbauer Avatar answered Oct 11 '22 06:10

Günter Zöchbauer