GoJS diagram is not binding when tried to create it using child component in AngularJS 4

I have created a child angular component and wrote all the code for creating GoJS diagram in it but unfortunately its not binding the diagram to div and hence not creating the diagram.
If we paste the same code in main component and run, it is creating the diagram, are there any things which we should consider specifically while creating the diagram through child component.
Can someone provide the sample code for it, if it is available.
Thanks!

By “child component” are you referring to something like the diagram-editor.component.* that is in the angular-basic project in the projects subdirectory?

Are you saying that the code that creates the Diagram isn’t even running when it’s defined in a child component? If that’s the case, you need to figure out why.