This repo demonstrates an issue that occurs when building a server side version of an angular project containing dynamically loaded components using the @angular/core Compiler
- clone this repo
- run:
npm run build:ssr
The build fails not recognizing Angular's classes, with errors:
- Value could not be determined statically.
- Unable to evaluate this expression statically. (x3)
- Unable to evaluate an invalid expression.
- Normal builds run with no errors (
ng serve
)
We need this so using a WYSIWYG editor, we can simply write a tag [tag]
and transform it to a <app-tag>
component
Following the example in this repo, we can use [counter start="2" step="2"]
to generate <app-counter start="2" step="2"><app-counter>
We can use javascript to make interactive HTML instead of the angular component, but the access to most of the angular/typescript code (api, logging, npm packages, ...) will be hacky or require a js rewrite, so this solution seems cleaner