Questions tagged [angular-compiler]
98 questions
2
votes
0 answers
error:`runtime compiler is not loaded` in aot mode
In my angular 6 project I want to define all routes of DashboardModule as a children of profile route in AppModule like below code
RouterModule.forRoot([
{
path: '',
component: HomeComponent
},
{
path: 'profile',
loadChildren:…

Ravi Sevta
- 2,817
- 21
- 37
2
votes
0 answers
How to attach a [formControl] to an type when instantiating it in Angular
I am trying to attach a [formControl] (and other top level attributes) to an object that I create with a ComponentFactoryResolver in order to handle the form logic with a ControlValueAccessor.
Basically I do this:
@Component({selector:…

jsgoupil
- 3,788
- 3
- 38
- 53
2
votes
0 answers
Render html element string(with the custom directive on element.) Angular 4.3+ with AOT
I have HTML element string coming from the backend with the custom directive on element.
For example:
str = "abc xyz qwerty pqrs"
I want to render this as HTML so customDirective get in the action.
I get this…

Lahar Shah
- 7,032
- 4
- 31
- 39
2
votes
1 answer
Angular - Dynamic Component - Compiler Issue - Memory Leak?
I am trying to create a dynamic component. Here is the sample in plunker. http://embed.plnkr.co/EVFglgkp24hkRkpxrEGe/
Everything is working but there is a memory leak.
Here is the github ticket…

Rajkumar
- 153
- 8
2
votes
0 answers
Using AoT pre-compiled component factories for JiT compilation
I have a random markups from back-end that should be compiled in runtime with JiT. Every component used in this markups is already pre-compiled with AoT (added to entryComponents block) and so has component factory in runtime. When JiT compiles…

drow
- 194
- 3
- 15
2
votes
2 answers
How can I initiate watch mode with ngc?
I would like to do the same, as I could in the good old tsc times: simply calling a tsc -w, and in the case of a changed file, it will be on the fly recompilated.
Unfortunately, ngc doesn't even seem to react anything to the -w flag, and even its…

peterh
- 11,875
- 18
- 85
- 108
1
vote
0 answers
How to create angular @Input/@Output wrapper
I have been experimenting with Angular 16, particularly with zoneless and signals, and I've accomplished some interesting stuff.
When working with component communication using @Input(), I found myself writing repetitive and cumbersome code like…

Jeshua Hinostroza
- 11
- 1
- 1
1
vote
0 answers
Unable to Get Annotations in AOT Prod Mode in Angular
I have a need for dynamically creating routes and components in Angular. And I have such code block to get components which are defined in module from declarations property;
import { ɵReflectionCapabilities as ReflectionCapabilities } from…

vvvnn
- 241
- 2
- 10
1
vote
1 answer
Change Selector of Component coming from Library
Context
I am working on a user interface library - which in itself is consuming another Angular Library which provides own components (for the sake of the example let's assume it's the Angular Material Library. Some of the components provided are…

Maximilian C.
- 967
- 5
- 22
1
vote
0 answers
Angular compile xml like it would be html
I would like to create a dynamic xml datasource that can have templates.
Because I already use Angular and have a lot of custom pipes, I would like to work with the Angular syntax and let Angular do the converting and formating for me.
So basic…

Franki1986
- 1,320
- 1
- 15
- 40
1
vote
1 answer
Angular 7 SCSS Doesn't Keep CSS Custom Properties
I'm trying to use CSS Custom properties in my Angular 7 app but am running into issues where building down to css gets rid of the property that is set to a CSS variable.
SCSS
:root {
--my-test-var: red;
}
.testclass123 {
height: 150px;
…

rycirese
- 179
- 1
- 14
1
vote
2 answers
Why cant my Angular CLI find module '@angular/compiler-cli/ngcc'?
After successfully installing the PWA component in order to make my Angular app a Progressive Web Application via ng add @angular/pwa --project myProjectName, I cant seem to fire up my app any more.
When I try starting up my app via ng serve -o I…

SirBT
- 1,580
- 5
- 22
- 51
1
vote
1 answer
Angular Dynamic Html Template component with event emitter
I am trying to extend the functionality of this component by adding a generic event emitter
import {
Component,
Directive,
NgModule,
Input,
ViewContainerRef,
Compiler,
ComponentFactory,
ModuleWithComponentFactories,
ComponentRef,
…

smclaughlin
- 11
- 3
1
vote
0 answers
Unable to use async pipe in a template of dynamically generated component in dynamically generated Angular module in AOT mode
Disclaimer: this question has been inspired by "Here is what you need to know about dynamic components in Angular" post on Medium.
There an author shows how one can dynamically generate both a module and a component, put the latter into the former,…

Viacheslav Moskalenko
- 1,034
- 8
- 14
1
vote
1 answer
Angular: How to import JitCompilerFactory?
If I use AOT compilation dynamic compilation will not possible. So I need to load the compiler to a browser. So how do I load it? If I use
import { JitCompilerFactory } from '@angular/compiler';
However, after importing the JitCompilerFactory I am…

Dmitry Anikeychik
- 23
- 1
- 4