fix(checkbox): server-side rendering error when checking textContent (#5470)

Adds an extra null check when trimming the checkbox `textContent`. This avoids issues in Universal where the `textContent` will be undefined.

Fixes #5453.
This commit is contained in:
Kristiyan Kostadinov
2017-07-28 17:59:33 +03:00
committed by Andrew Seguin
parent 41c804b36a
commit 0314bd8025
+1 -1
View File
@@ -1,6 +1,6 @@
<label [attr.for]="inputId" class="mat-checkbox-layout" #label>
<div class="mat-checkbox-inner-container"
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent.trim()">
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent || !checkboxLabel.textContent.trim()">
<input #input
class="mat-checkbox-input cdk-visually-hidden" type="checkbox"
[id]="inputId"