My work is inspired by a similar issue discussed here:
creating and compiling dynamic Components with Angular 2.0
How can I use/create dynamic template to compile dynamic Component with Angular 2.0?
The functional plunker mentioned in the question above is available here.
An error arises when attempting to create another dynamic view within dynamic-detail in the template, resulting in the following exception:
'dynamic-detail' is not a known element: 1. If 'dynamic-detail' is an Angular component, then verify that it is part of this module.
This issue can be replicated by modifying the logic in the plunker to generate a dynamic template that includes "
<dynamic-detail></dynamic-detail>
".
In the file "app/dynamic/template.builder.ts" I made the following code adjustment:
let editorName = useTextarea
? "text-editor"
: "string-editor";
To
let editorName = useTextarea
? "dynamic-detail"
: "string-editor";
After making this change, I encountered the aforementioned exception. It seems the compiler struggles with recognizing dynamic-detail when used recursively.
I have attempted to import DynamicDetail into various modules without success. Perhaps this is not the correct approach for resolving the issue.