-3
'전체'라디오 버튼을 클릭하면 전체 표를 표시하려고합니다. 남성 라디오 버튼을 클릭하면 '남성'만 포함 된 행을 표시하려고합니다. 여성 라디오 버튼을 클릭하면 '여성'만 포함 된 행을 표시하려고합니다. 그것이 보여주는 것은 모두 빈 페이지입니다. 내 코드 :* 여러 조건이 작동하지 않는 ngIf
<form>
<input type="radio" name="r" [(ngModel)] = "chk1"> All
<input type="radio" name="r" [(ngModel)] = "chk2"> male
<input type="radio" name="r" [(ngModel)] = "chk3"> female
</form>
<table>
<tr>
<th>Name</th>
<th>Gender</th>
</tr>
<tr *ngIf = "(chk1 || chk2">
<td>abc</td>
<td>male</td>
</tr>
<tr *ngIf = "chk1 || chk3">
<td>xyz</td>
<td>female</td>
</tr>
</table>
첫 번째 * ng에는 구문 오류가 있습니다. '(' –
콘솔에 메시지가 있다고 상상해보십시오.이 메시지를 읽는 것이 좋습니다. – jonrsharpe
[How to use \ * ng 다른 방법은 Angular 4?] (https://stackoverflow.com/questions/43006550/how-to-use-ng-else-in-angular-4) – Aravind