I want to trigger the hiding/showing of a div in a component template outside the router outlet by clicking a button in a component template within the router outlet:
app component
`<div class="content col-md-10 container-fluid">
<company-add-form></company-add-form>
<router-outlet></router-outlet>
</div>`
company-add-form component
`<div>
<p>Make me showwwww</p>
<button class="btn">Close</button>
</div>`
company-page component (which will render inside router-outlet)
`<div>
<button class="btn">Open company add form</button>
</div>`
Thoughts
- Usually theres a pretty consistent parent to child relationship but because router outlet sits in between you can't just use ViewChild.