1

I am currently trying to build a component that converts a JSON into HTML. To do this, I have a component that outputs the content and integrates further components depending on the type.

However, if there is more than one level, there are problems.

main.ts:5 ERROR TypeError: Cannot read properties of undefined (reading 'ɵcmp')

Here is a project that shows the error. Do you have an idea how to solve it?

https://stackblitz.com/edit/stackblitz-starters-ece9iuri?file=src%2Fmain.ts

3
  • You have a dependency cycle. Commented Jan 24 at 17:44
  • How else can I solve it? Commented Jan 24 at 17:46
  • What's the issue with forwardRef ? Commented Jan 24 at 19:10

1 Answer 1

1

You have a dependency cycle, you can break it by using forwardRef.

Eg:

  imports: [forwardRef(() => ChildBuilderComponent), NgIf],
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.