angular – Is there a way to hide a closure container in a model?

I may cache DOM child / grandchild items with * ngIf, but the parent and grandparent elements have formatting that remains even when the child / grandchildren have been removed from the DOM (the limits remain). Is it possible to hide parent / grandparent elements to completely remove formatting when children / grandchildren are deleted?