问题
I am getting this error in Edge but in chrome everything is fine Unable to understand what is wrong here...
<div class="container-fluid project_img" style="background: url({{_project.images.web}}) no-repeat center center;">
</div>
Error in Microsoft Edge:
Assignment to read-only properties is not allowed in strict mode in [background: url({{_project.images.web}}) no-repeat center center; in ProjectDetailComponent
回答1:
Use instead
<div class="container-fluid project_img" [style.background]="'url(' + _project.images.web + ') no-repeat center center;'">
</div>
回答2:
This is how it worked for me
<div class="container-fluid project_img" attr.style.background="url({{_project.images.web}}) no-repeat center center;">
来源:https://stackoverflow.com/questions/36198547/assignment-to-read-only-properties-is-not-allowed-in-strict-mode-in-background