I want to dynamically append a blurred class to my angular components. My app.component.html file looks like this:
<app-navbar [ngClass]="{blurred: shouldBlurComponent}"></app-navbar>
<div class="main">
<div [ngClass]="{blurred: shouldBlurComponent}">
<app-header></app-header>
</div>
<div class="router-outlet">
<router-outlet ></router-outlet>
</div>
<app-footer [ngClass]="{blurred: shouldBlurComponent}"></app-footer>
</div>
My blurred class looks like this:
.blurred {
-webkit-filter: blur(5px) grayscale(90%);
}
It produces an effect like this (my layout is destroyed):
As you can see it works correctly only for app-header component because it is wrapped in div selectors. Unfortunately similar trick does not work for other components.
I also tried to apply blurred class directly inside of my app-navbar and app-footer component and it works like it supposed to.

How can I add correctly my blurred class to my child component from my app.component.html? If it is possible I want to avoid passing it as a parameter.
EDIT:
app-footer html
<footer class="fixed-footer">
<div class="row">
<div class="col-md-5">
<a>{{'footer.adminContact' | translate}}</a>
</div>
<div class="col-md-5">
{{'footer.disclamer' | translate}}
</div>
</div>
</footer>
app-footer ts
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
app-footer css
.fixed-footer{
width: 100%;
position: fixed;
bottom: 0;
background-color: #5e5e5e;
border-color: black;
color: black;
text-align: center;
padding: 30px;
border-top: 2px black solid;
z-index:1;
}
EDIT2:
I've made a simple demo Working demo here:
app-footerhtml and ts