1

I'm trying to use Angular's AOT compiling in VS Code. The output files will then be used in a separate application that uses Handlebars. I do not have access to edit the js that will be consuming these files.

When using both Angular and Handlebars, the Angular AOT compiler crashes when trying to parse the Handlebars directives, since they use the same interpolation characters.

Since I can't change the Handlebars interpolation characters, I need to change the Angular interpolation characters. However, all examples I have found assume you're using the JIT compiler and not AOT.

However I can't find any information on how to implement this at compile time. I've tried putting it in app.module.ts, however that did not work.

I'm still relatively new to Angular, so I'm not sure where I can get a reference to the app and execute this code at compile-time.

EDIT: It has been brought to my attention that AngularJS and Angular are not the same thing. The example I provided was for AngularJS, and have been removed. I am using Angular 7.2. I have not been able to find any information on changing the interpolation characters in Angular.

charles082986
  • 141
  • 1
  • 3
  • 12
  • The documentation link is for angularjs and not for Angular. Are you looking for angularjs or Angular(2+) solution? – Niladri May 08 '19 at 20:19
  • I think angular 7? I have this in my package.json: "@angular/core": "~7.2.0" I'm very new to angular, so I'm still fumbling around with the terminology. – charles082986 May 08 '19 at 20:26
  • This answer can help you https://stackoverflow.com/questions/39819407/interpolateprovider-in-angularjs-2 – Niladri May 08 '19 at 20:45
  • But in angular 7 i think it's not possible to set that regex in app.module as CompilerConfig no longer have the property for interpolation, instead you need to set it at the @Component() decorator like this https://angular.io/api/core/Component#interpolation – Niladri May 08 '19 at 20:47

0 Answers0