Actually the minimum amount of Angular to be used (as requested in the original question) is just adding a class to the DOM element when show
variable is true, and perform the animation/transition via CSS.
So your minimum Angular code is this:
<div class="box-opener" (click)="show = !show">
Open/close the box
</div>
<div class="box" [class.opened]="show">
<!-- Content -->
</div>
With this solution, you need to create CSS rules for the transition, something like this:
.box {
background-color: #FFCC55;
max-height: 0px;
overflow-y: hidden;
transition: ease-in-out 400ms max-height;
}
.box.opened {
max-height: 500px;
transition: ease-in-out 600ms max-height;
}
If you have retro-browser-compatibility issues, just remember to add the vendor prefixes in the transition
s.
See the example here