angular添加标签到使用*ngFor创建的复选框

the*_*ter 0 html angular angular5

我正在使用角5

我使用以下代码创建多个复选框,并需要给它们标签

<input type="checkbox" *ngFor = "let v of options[0].options" [value]="1" [name] = "1">
Run Code Online (Sandbox Code Playgroud)

使用HTML时我会使用

如何在*ngFor中使用标签并创建合适的标签?

谢谢

Luc*_*uca 5

<label *ngFor = "let v of options[0].options">
    <input type="checkbox">
</label>
Run Code Online (Sandbox Code Playgroud)

或者你可以使用 ng-container

<ng-container *ngFor = "let v of options[0].options">
    <label for...></label>
    <input ...>
</ng-container>
Run Code Online (Sandbox Code Playgroud)