To create a dynamic template, we need to a entry component as a placeholder. Then we can use entry component to create a new Tamplete into it. import { Component, TemplateRef, ComponentRef, ViewContainerRef, ViewChild, AfterContentInit, ComponentFact…