I have three angular components. One is a footer component, which is displayed as a footer for the page. One is a chat component, that can be called from anywhere. One is the main app component, where my website layout is written.
I would like to include a link in the footer, that renders the chat component present in the app component. The chat component should be rendered only on the click of the link in the footer.
HTML for footer component:
<a (click)="showChatWindow()">Show Chat Window</a>
HTML for chat component:
<div class="chatbox">
<div class="chatHeader">
Chat Window
</div>
<div class="chatBody">
Chat Body
</div>
<div class="chatFooter">
Chat Footer
</div>
</div>
App Component. It has app-chatbot and app-footer :
<div class="main-container">
<app-header class="header"></app-header>
<div class="content-container">
<app-main-nav></app-main-nav>
<div class="main-content">
<div class="content-area">
<router-outlet></router-outlet>
<app-chatbot></app-chatbot>
</div>
<app-footer class="footer"></app-footer>
</div>
</div>
</div>