See https://github.com/angular/angular/blob/master/aio/content/guide/structural-directives.md From the structural-directives.md: The rest of the <div>, including its class attribute, moved inside the <ng-template> element. Maybe this made sense at one time but it has become out of sync. PR Close #19446