-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't include static json content as part of template html #10886
Comments
Your best option is to use ngNonBindable ( https://github.com/angular/angular/blob/231ed695075b494d892c16e8c98765955b9d8868/modules/%40angular/common/test/directives/non_bindable_spec.ts ), although it sounds like a pita if you have to put that everywhere. |
@ericmartinezr i already tried ngNonBindable, it doesn't ignore template parsing still throws same error. |
+1, ran into the same issue where we're providing code examples. ngNonBindable was what we were using before, but it no longer works with >=RC5. Ended up just escaping as described, but it would be nice to have a simpler solution. |
Plunker to reproduce? |
@zoechi plunker url below |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When we include json content as part of template html, we are getting template parsing errors like below. we use json content heavily in our current Angular v1 application to inject locale content to be used in directive html text labels.
Template parse errors:
Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) ("
}
Ex: page template html (use custom directive transcluded with json content)
`
{ "lblFName": "xyz" }
custom directive template html (we internally get the transcluded json content to vm.content variable and use it in the directive template)
<span>{{::vm.content.lblFName}}</span>
we are trying to research on upgrading our application to Angular2 with RC5 version but getting template parsing errors when trying to include json content like above. Do we have any other options to support this feature in Angular2 or allow us to override or add support to Angular2 template parser to ignore json content like above ...
Error message specifies, that we need to escape { char with '{', having to escape complex json content structure would be time consuming and we are looking for any other options are available in Angular2 for this...
The text was updated successfully, but these errors were encountered: