Home:ALL Converter>What is the replacement for the Angular Compiler in v14?

What is the replacement for the Angular Compiler in v14?

Ask Time:2022-08-27T10:39:34         Author:Leslie Hanks

Json Formatter

I am trying to upgrade to Angular 14. My current app uses the Compiler from '@angular/core' to compile angular templates at runtime. In order to use it I had to include the --aot=false flag when I built. I know has been deprecated for a few versions.

After upgrading, I am getting errors trying to build saying "template must be a string". This is in response to me attempting to create an angular Component at runtime.

Just to be clear, what I mean by an angular template string would be something like

    let angularTemplateString = 'Hello {{ firstNameFromPassedInContext }}';

They get much more complex, but that's the gist of it.

I suspect that there is still a way to compile angular templates at runtime in v14. Does anyone know how to do this, or if there is a better way to do this that is compatible with v14?

Author:Leslie Hanks,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73508000/what-is-the-replacement-for-the-angular-compiler-in-v14
yy