<!-- 父组件 father.html -->
<div class="wrapper">
<app-child></app-child>
</div>
<!-- 子组件 child.html -->
<div class="modal-header">123</div>
方法一,在父组件样式文件中修改子组件样式
.wrapper{
::ng-deep {
.modal-header{
color: red
}
}
}
方法二,在子组件样式文件中,根据父组件来改变自身样式
:host-context(.wraper) .modal-header {
color: red;
}